Opened 7 years ago
Closed 5 years ago
#39 closed defect (fixed)
Tile grid cannot be enabled for new picture
|Reported by:||HoraK-FDF||Owned by:||Thomas Bernard|
the bug can be reproduced as follows:
- start GrafX2
- don't load any picture!
- optionally you can set an resolution for the picture that don't stops the bug from happening
- try to toggle Tile Grid alt+shift+g
- no grid will show up
- if file gets saved grid starts to work
- if you overwrite a picture grid becomes visible when the message "Erase old File ?" appears
Change History (8)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
oh yes the its a dark blue i don't saw it because it was very bright here that day but now at night i also see it so it only has the wrong color it turns to white if save/load menu is opened and closed so somewhere when closing the menu or getting the erase old file message must be the part of code that does set the right color somehow, can this code than not simply copied to the first draw of the grid? I looked a bit around but i'm not in the code i saw the function Redraw_grid in the save/load code maybe this must be called after the grid is activated?
comment:3 by , 7 years ago
The grid colors are picked from the "XOR table" computed by compute_xor_table. I think the problem is that function is called at the wrong place (before the palette is set) or not called at all, resulting in an incorrect XOR table. The table is used to decide which color is "most different" from another one, and that is in turn used to draw the grid as visible as possible.
Since the grid itself is drawn correctly, Redraw_grid is working fine. It's just a problem of having the right XOR table to use the correct colors.
comment:4 by , 5 years ago
|Milestone:||2.5 → 2.6|
comment:5 by , 5 years ago
|Status:||new → assigned|
comment:6 by , 5 years ago
OK I understand what it is about.
compute_xor_table() is called (indirectly) by Compute_optimal_menu_colors()
at init Compute_optimal_menu_colors() si called on a palette before it is copied to Main.Palette.
But compute_xor_table does all its work on the main palette :(
comment:8 by , 5 years ago
|Status:||assigned → closed|
I get a grid here, but it uses the wrong color (blue on black instead of white on black). It looks like the compute_xor_table function is not run at the right place, but I'm not sure where to move it. If I read the code correctly, remapping of menu sprites (where it is plugged) should happen even when loading the initial skin?