Opened 7 years ago
Last modified 7 years ago
#88 new defect
UIPainter canvas with grid on shows artefacts when restarted from a snapshot.
Reported by: | Jan Vrany | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | default | Keywords: | |
Cc: | Also affects CVS HEAD (eXept version): | no |
Description
This is a follow up for #86
Very good, that should help. The raster thing is indeed fishy and I > feel is first symptom.
The raster is implemented as on-the-fly generated bitmap which is then set as canvas background. So perhaps upon snapshot restart, something gets terribly wrong. Will see.
...
As for the raster issue: the problem is likely that the raster pixmap is created from scratch by drawing onto a Windowx bitmap. When an image is saved, the Form has not backing data so upon snapshot restart, the form is recreated but with random data (what used to be at place where Windows allocated them).
So, we need to save the data by #getBits before image is saved. That should fix it.
Attachments (2)
Change History (7)
Changed 7 years ago by
comment:1 Changed 7 years ago by
comment:2 Changed 7 years ago by
Yes it works correctly on my Archlinux instance too, so it will be Windows-specific issue.
comment:3 Changed 7 years ago by
Observation: after more research, the problem is much more complex than I thought. Form data are remembered but not properly recreated, i.e., not properly copied from Smalltalk ByteArray? to GDI's bitmap object. Follow the code path from Form>>recreate
comment:4 Changed 7 years ago by
Observation too: The artifacts are not random. They are connected to the correct "original dots". My guess would be that the recreate ignores masking of the x, y placements (calculation) and place them in everywhere in the x, y axes.
in the
Form > initialize
maskedPixelsAre0 := false.
Maybe this gets ignored and maskedPixelsAre0 remains false.
comment:5 Changed 7 years ago by
I think the problem is that when form is recreated, a wrong depth is used. When Form
is created with depth specified (see Form>>width:height:depth:
).
But the From
itself does not know the it's depth, it's not stored anywhere, so when recreated it has to be computed from data bytearray size. It all ends up in WinWorkstation>>primCreateBitmapFromArray:width:height: so this method has to be checked whether it's correct and does the depth computation right.
Will have a look it later.
Under X11 it works just fine, so it's Windows-specific.