Implemented issue 327: Having the magnifier settings identical for main and spare page
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1622 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
6d059e7234
commit
e5703c0895
@ -928,7 +928,7 @@ void Button_Settings(void)
|
|||||||
{"Separate colors:",1,&(selected_config.Separate_colors),0,1,0,Lookup_YesNo},
|
{"Separate colors:",1,&(selected_config.Separate_colors),0,1,0,Lookup_YesNo},
|
||||||
{"Safety colors:",1,&(selected_config.Safety_colors),0,1,0,Lookup_YesNo},
|
{"Safety colors:",1,&(selected_config.Safety_colors),0,1,0,Lookup_YesNo},
|
||||||
{"Grid XOR color:",1,&(selected_config.Grid_XOR_color),0,255,3,NULL},
|
{"Grid XOR color:",1,&(selected_config.Grid_XOR_color),0,255,3,NULL},
|
||||||
{"",0,NULL,0,0,0,NULL},
|
{"Sync views:",1,&(selected_config.Sync_views),0,1,0,Lookup_YesNo},
|
||||||
{"",0,NULL,0,0,0,NULL},
|
{"",0,NULL,0,0,0,NULL},
|
||||||
|
|
||||||
{" --- Input ---",0,NULL,0,0,0,NULL},
|
{" --- Input ---",0,NULL,0,0,0,NULL},
|
||||||
@ -1513,6 +1513,9 @@ void Button_Page(void)
|
|||||||
|
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
|
|
||||||
|
if (Config.Sync_views)
|
||||||
|
Copy_view_to_spare();
|
||||||
|
|
||||||
// On dégrossit le travail avec les infos des listes de pages
|
// On dégrossit le travail avec les infos des listes de pages
|
||||||
Exchange_main_and_spare();
|
Exchange_main_and_spare();
|
||||||
|
|
||||||
@ -1627,28 +1630,7 @@ void Copy_image_only(void)
|
|||||||
Spare_image_height=Main_image_height;
|
Spare_image_height=Main_image_height;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Copie des décalages de la fenêtre principale (non zoomée) de l'image
|
Copy_view_to_spare();
|
||||||
Spare_offset_X=Main_offset_X;
|
|
||||||
Spare_offset_Y=Main_offset_Y;
|
|
||||||
|
|
||||||
// Copie du booléen "Mode loupe" de l'image
|
|
||||||
Spare_magnifier_mode=Main_magnifier_mode;
|
|
||||||
|
|
||||||
// Copie du facteur de zoom du brouillon
|
|
||||||
Spare_magnifier_factor=Main_magnifier_factor;
|
|
||||||
|
|
||||||
// Copie des dimensions de la fenêtre de zoom
|
|
||||||
Spare_magnifier_width=Main_magnifier_width;
|
|
||||||
Spare_magnifier_height=Main_magnifier_height;
|
|
||||||
|
|
||||||
// Copie des décalages de la fenêtre de zoom
|
|
||||||
Spare_magnifier_offset_X=Main_magnifier_offset_X;
|
|
||||||
Spare_magnifier_offset_Y=Main_magnifier_offset_Y;
|
|
||||||
|
|
||||||
// Copie des données du split du zoom
|
|
||||||
Spare_separator_position=Main_separator_position;
|
|
||||||
Spare_X_zoom=Main_X_zoom;
|
|
||||||
Spare_separator_proportion=Main_separator_proportion;
|
|
||||||
|
|
||||||
// Update the visible buffer of the spare.
|
// Update the visible buffer of the spare.
|
||||||
// It's a bit complex because at the moment, to save memory,
|
// It's a bit complex because at the moment, to save memory,
|
||||||
|
|||||||
@ -902,7 +902,14 @@ int Load_INI(T_Config * conf)
|
|||||||
conf->Right_click_colorpick=(values[0]!=0);
|
conf->Right_click_colorpick=(values[0]!=0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
conf->Sync_views=1;
|
||||||
|
// Optional, synced view of main and spare (>=2.3)
|
||||||
|
if (!Load_INI_get_values (file,buffer,"Sync_views",1,values))
|
||||||
|
{
|
||||||
|
conf->Sync_views=(values[0]!=0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Insert new values here
|
||||||
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|
||||||
|
|||||||
@ -677,6 +677,12 @@ int Save_INI(T_Config * conf)
|
|||||||
if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Right_click_colorpick",1,values,1)))
|
if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Right_click_colorpick",1,values,1)))
|
||||||
goto Erreur_Retour;
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
values[0]=(conf->Sync_views);
|
||||||
|
if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Sync_views",1,values,1)))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
// Insert new values here
|
||||||
|
|
||||||
Save_INI_flush(Ancien_fichier,Nouveau_fichier,buffer);
|
Save_INI_flush(Ancien_fichier,Nouveau_fichier,buffer);
|
||||||
|
|
||||||
fclose(Nouveau_fichier);
|
fclose(Nouveau_fichier);
|
||||||
|
|||||||
@ -332,6 +332,7 @@ typedef struct
|
|||||||
word Double_key_speed; ///< Maximum delay for double-keypress, in ms.
|
word Double_key_speed; ///< Maximum delay for double-keypress, in ms.
|
||||||
byte Grid_XOR_color; ///< XOR value to apply for grid color.
|
byte Grid_XOR_color; ///< XOR value to apply for grid color.
|
||||||
byte Right_click_colorpick; ///< Boolean, true to enable a "tablet" mode, where RMB acts as instant colorpicker
|
byte Right_click_colorpick; ///< Boolean, true to enable a "tablet" mode, where RMB acts as instant colorpicker
|
||||||
|
byte Sync_views; ///< Boolean, true when the Main and Spare should share their viewport settings.
|
||||||
} T_Config;
|
} T_Config;
|
||||||
|
|
||||||
// Structures utilisées pour les descriptions de pages et de liste de pages.
|
// Structures utilisées pour les descriptions de pages et de liste de pages.
|
||||||
|
|||||||
@ -1812,7 +1812,36 @@ void Change_magnifier_factor(byte factor_index, byte point_at_mouse)
|
|||||||
Compute_paintbrush_coordinates();
|
Compute_paintbrush_coordinates();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Copy_view_to_spare(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Don't do anything if the pictures have different dimensions
|
||||||
|
if (Main_image_width!=Spare_image_width || Main_image_height!=Spare_image_height)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Copie des décalages de la fenêtre principale (non zoomée) de l'image
|
||||||
|
Spare_offset_X=Main_offset_X;
|
||||||
|
Spare_offset_Y=Main_offset_Y;
|
||||||
|
|
||||||
|
// Copie du booléen "Mode loupe" de l'image
|
||||||
|
Spare_magnifier_mode=Main_magnifier_mode;
|
||||||
|
|
||||||
|
// Copie du facteur de zoom du brouillon
|
||||||
|
Spare_magnifier_factor=Main_magnifier_factor;
|
||||||
|
|
||||||
|
// Copie des dimensions de la fenêtre de zoom
|
||||||
|
Spare_magnifier_width=Main_magnifier_width;
|
||||||
|
Spare_magnifier_height=Main_magnifier_height;
|
||||||
|
|
||||||
|
// Copie des décalages de la fenêtre de zoom
|
||||||
|
Spare_magnifier_offset_X=Main_magnifier_offset_X;
|
||||||
|
Spare_magnifier_offset_Y=Main_magnifier_offset_Y;
|
||||||
|
|
||||||
|
// Copie des données du split du zoom
|
||||||
|
Spare_separator_position=Main_separator_position;
|
||||||
|
Spare_X_zoom=Main_X_zoom;
|
||||||
|
Spare_separator_proportion=Main_separator_proportion;
|
||||||
|
}
|
||||||
|
|
||||||
// -- Afficher la barre de séparation entre les parties zoomées ou non en
|
// -- Afficher la barre de séparation entre les parties zoomées ou non en
|
||||||
// mode Loupe --
|
// mode Loupe --
|
||||||
|
|||||||
@ -109,4 +109,7 @@ void Change_magnifier_factor(byte factor_index, byte point_at_mouse);
|
|||||||
/// Width of one layer button, in pixels before scaling
|
/// Width of one layer button, in pixels before scaling
|
||||||
extern word Layer_button_width;
|
extern word Layer_button_width;
|
||||||
|
|
||||||
|
/// Copy viewport settings and offsets from the Main to the Spare.
|
||||||
|
void Copy_view_to_spare(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user