Page 1 of 1
Redraw artifacts
Posted: Tue Aug 16, 2022 8:09 pm
by WilliamL
I just discovered that in one of my programs that a routine that worked in 5.73 causes black artifacts when a screen is redrawn. I get anything from several lines in a ListViewGadget having splotchy areas to whole lines with splotches that cover most of the screen. The dark areas are very random in shape and position on page.
I will try to get some code to replicate the problem in a little while.
The code is fine in 5.73 LTS and broken 6.0LTS on the M1 version and the x64 version both.
Re: [6.0LTS]-redraw artifacts
Posted: Tue Aug 16, 2022 10:08 pm
by WilliamL
Ok, I find that, in my program, that the lines are too long and are over writing the visible text. I don't know why I can't reproduce it with the ListView example from Help but here is some code that has the problem (at least on my computer

.
Code: Select all
#showHDlistwnd=1
#maxfiles=100
#showHDlistefid=1
#geneva10=1
LoadFont(#geneva10,"Geneva",10)
;#geneva12=2
;LoadFont(#geneva12,"Geneva",12)
Global totitems=99
Global Dim DirList.s(#maxfiles,3)
ExamineDesktops()
Procedure ShowHDList()
Define z, lne,h=500,w=400
If OpenWindow(#showHDlistwnd,0,0,w,h,"Show HD List: ", #PB_Window_SystemMenu | #PB_Window_WindowCentered | #PB_Window_SizeGadget)
SetGadgetFont(#PB_Default, FontID(#geneva10))
;SetGadgetFont(#PB_Default, FontID(#geneva12))
ListViewGadget(#showHDlistefid,0,0,w,h)
lne=0
For z=1 To totitems
lne=64+z : If lne>154 : lne-64 : EndIf
DirList(z,1)=Chr(Lne)+" this is a long line that goes past the end of the screen"+" this is a long line that goes past the end of the screen"+" this is a long line that goes past the end of the screen"
dirlist(z,2)="Description"
dirlist(z,3)="Size"
AddGadgetItem(#showHDlistefid,-1,Chr(lne)+". "+DirList(z,1)+" in HD List)")
AddGadgetItem(#showHDlistefid,-1," "+DirList(z,2))
AddGadgetItem(#showHDlistefid,-1," "+DirList(z,3))
Next
EndIf
EndProcedure
Procedure DoShowHDList(event)
Define id,z
Select event
Case #PB_Event_CloseWindow
End
EndSelect
EndProcedure
ShowHDList()
; loop
Repeat
event = WaitWindowEvent()
Select event
Case #PB_Event_CloseWindow
End
EndSelect
ForEver
Re: [6.0LTS]-redraw artifacts
Posted: Wed Aug 17, 2022 9:04 pm
by mk-soft
PB Now uses its own drawing for the ListViewGadget and ListIconGadget items (rows).
Doesn't seem to get along with the font 'Geneva'. With another font it works
Re: [6.0LTS]-redraw artifacts
Posted: Fri Aug 18, 2023 5:03 pm
by Fred
We use [ParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; do draw the string and it seems to fail with this specific font. Probably an OS X issue.