Issue 123564 - Foreground and background color in bitmap editor exchanged after reopen
Summary: Foreground and background color in bitmap editor exchanged after reopen
Status: CLOSED FIXED
Alias: None
Product: Draw
Classification: Application
Component: ui (show other issues)
Version: 4.1.0-dev
Hardware: All All
: P3 Minor (vote)
Target Milestone: 4.1.0
Assignee: Armin Le Grand
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-28 08:33 UTC by Regina Henschel
Modified: 2017-05-20 10:34 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Regina Henschel 2013-10-28 08:33:37 UTC
Goto Draw > Format > Area > Bitmap
Create a Bitmap pattern with foreground black and background yellow.
Add the pattern and close the dialog.
Reopen the dialog and select the newly created pattern.
Notice, that the colors in the foreground and background fields are exchanged.

Only the list itself is effected. The mouse click in the editor pattern field still produces black on normal left click and yellow on right click.
Comment 1 Edwin Sharp 2013-10-28 09:43:25 UTC
Bitmap pattern is lost.
AOO410m1(Build:9750)  -  Rev. 1525015
Rev.1525015
Win 7
Comment 2 Armin Le Grand 2013-10-28 09:50:15 UTC
ALG: Grepping...
Comment 3 Armin Le Grand 2013-10-29 15:57:59 UTC
ALG: Looks like a combination of small errors. First, it's surprising that indeed the empty 1st entry in the bitmap list is a 8x8, 2 color bitmap with the color[0] being black and the color[1] being white and all pixels set; I would have expected the colors to be swapped and no pixels set. Nonetheless, the bitmap editor has to work with what is there. Correcting isHistorical8x8 to get the correct back (color[0]) and front color (color[1]), this is definitely wrong...
Comment 4 Armin Le Grand 2013-10-29 17:37:57 UTC
ALG: Basic errors found; this is also affected by the already fixed task 123497, but there is more:
- When using bitmaps with 1bit depth (as in this example) and colors, the fill in the view gets Black/white -> the internal bitmap scale used to prepare the tiling paint creates B&W bitmaps when forcing back to 1bit Argh!
- When zooming far out and the prescaled bitmaps for tiling get 0 in width and/or height, the fill will be missing completely. Argh!

All changed and adapted, looks good now. Preparing checkin...
Comment 5 SVN Robot 2013-10-29 17:40:44 UTC
"alg" committed SVN revision 1536830 into trunk:
i123564 corrected some aspects when working whith bitmaps with low color dept...
Comment 6 Armin Le Grand 2013-10-29 17:40:53 UTC
ALG: This shows again how needed a rework of bitmap processing in the whole AOO would be, sigh...
Comment 7 Armin Le Grand 2013-10-29 17:41:08 UTC
ALG: Okay, done.
Comment 8 Regina Henschel 2013-10-30 11:50:47 UTC
The error, that the color switches between the fields with each opening of the dialog is fixed. But the field "Background color" in the dialog now has "black" and the field "Foreground color" has "white" and changing the color in the field "Foreground color" changes actually the background. Only the fields are affected, the part "Pattern Editor" sets correctly "black" on click. It seems, that the linkage between the dialog fields and the internal meaning of the colors is wrong.
Comment 9 Armin Le Grand 2013-10-30 15:53:05 UTC
ALG: No, this is irritating but correct; the default 8x8 bitmap 'Blank' used as start for this indeed has background color (color[0]) black and foreground color (color[1]) white and *all* pixels are set.
When you change foreground color from white to e.g. red all formally white pixels get red because all pixels are set.
When you click in the pattern editor the color gets black (to background color) because the pixel changes from 'set' to 'unset' -> background.
You may check with adding (importing) an own 8x8 bitmap with two colors (bg white, fg black and no pixel set), it will also work. Why the initial 'Blank' bitmap is defined as described is strange, but the pixel editor has to work with it as it is.
Comment 10 Armin Le Grand 2013-11-01 09:27:56 UTC
ALG: Back to resolved after some wait time. Fell free to reopen/comment if you find something!