Fix crashing bug when you click a layer button, hold it, and release past the edges of the layer buttons. Fix a display bug when layer bar is hidden and you use the shortcut actions.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1202 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
e2f4ed00f1
commit
951600da1e
2
engine.c
2
engine.c
@ -69,7 +69,7 @@ char * Menu_tooltip[NB_BUTTONS]=
|
||||
"Layerbar / Hide menu ",
|
||||
|
||||
"Layers manager ",
|
||||
"Select transparent color",
|
||||
"Get/Set transparent col.",
|
||||
"Merge layer ",
|
||||
"Add layer ",
|
||||
"Drop layer ",
|
||||
|
||||
16
layers.c
16
layers.c
@ -134,21 +134,33 @@ void Button_Layer_remove(void)
|
||||
|
||||
void Button_Layer_select(void)
|
||||
{
|
||||
word layer;
|
||||
short layer;
|
||||
// Determine which button is clicked according to mouse position
|
||||
layer = (Mouse_X/Menu_factor_X - Menu_bars[MENUBAR_LAYERS].Skin_width)
|
||||
/ Layer_button_width;
|
||||
|
||||
// Safety required because the mouse cursor can have slided outside button.
|
||||
if (layer < 0)
|
||||
layer=0;
|
||||
else if (layer > Main_backups->Pages->Nb_layers-1)
|
||||
layer=Main_backups->Pages->Nb_layers-1;
|
||||
|
||||
Layer_activate(layer, LEFT_SIDE);
|
||||
}
|
||||
|
||||
void Button_Layer_toggle(void)
|
||||
{
|
||||
word layer;
|
||||
short layer;
|
||||
// Determine which button is clicked according to mouse position
|
||||
layer = (Mouse_X/Menu_factor_X - Menu_bars[MENUBAR_LAYERS].Skin_width)
|
||||
/ Layer_button_width;
|
||||
|
||||
// Safety required because the mouse cursor can have slided outside button.
|
||||
if (layer < 0)
|
||||
layer=0;
|
||||
else if (layer > Main_backups->Pages->Nb_layers-1)
|
||||
layer=Main_backups->Pages->Nb_layers-1;
|
||||
|
||||
Layer_activate(layer, RIGHT_SIDE);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user