Opened 4 years ago

Closed 2 years ago

#39 closed defect (fixed)

Tile grid cannot be enabled for new picture

Reported by: HoraK-FDF Owned by: Thomas Bernard
Priority: major Milestone: 2.6
Component: GrafX2 Version: 2.5
Keywords: Cc:



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 Changed 4 years ago by pulkomandy

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?

comment:2 Changed 4 years ago by HoraK-FDF

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 Changed 4 years ago by pulkomandy

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 Changed 3 years ago by PulkoMandy

Milestone: 2.52.6

comment:5 Changed 3 years ago by PulkoMandy

Owner: changed from pulkomandy to PulkoMandy
Status: newassigned

comment:6 Changed 2 years ago by Thomas Bernard

Owner: changed from PulkoMandy to Thomas Bernard

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 Changed 2 years ago by Thomas Bernard

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.