Permalink
Browse files

fixes #380

  • Loading branch information...
1 parent 2954d59 commit 50a4d80f961c1257aea8d2a4494caa0378d64709 @coolwanglu coolwanglu committed Mar 15, 2013
Showing with 17 additions and 14 deletions.
  1. +9 −6 fontforge/charview.c
  2. +4 −4 fontforge/noprefs.c
  3. +4 −4 fontforge/prefs.c
View
@@ -73,8 +73,10 @@ extern int clear_tt_instructions_when_needed;
int use_freetype_with_aa_fill_cv = 1;
int interpCPsOnMotion=false;
int DrawOpenPathsWithHighlight = 1;
-int default_cv_width = 540;
-int default_cv_height = 540;
+#define default_cv_width 540
+#define default_cv_height 540
+int cv_width = default_cv_width;
+int cv_height = default_cv_height;
extern struct lconv localeinfo;
extern char *coord_sep;
@@ -4985,9 +4987,9 @@ return;
cv->width = newwidth; cv->height = newheight;
/*CVFit(cv);*/ CVNewScale(cv);
CVPalettesRaise(cv);
- if ( cv->b.container == NULL && ( default_cv_width!=size.width || default_cv_height!=size.height )) {
- default_cv_width = size.width;
- default_cv_height = size.height;
+ if ( cv->b.container == NULL && ( cv_width!=size.width || cv_height!=size.height )) {
+ cv_width = size.width;
+ cv_height = size.height;
SavePrefs(true);
}
}
@@ -11011,7 +11013,8 @@ CharView *CharViewCreate(SplineChar *sc, FontView *fv,int enc) {
if ( wattrs.icon )
wattrs.mask |= wam_icon;
pos.x = GGadgetScale(104)+6;
- pos.width=default_cv_width; pos.height = default_cv_height;
+ pos.width = (cv_width > 0) ? cv_width : default_cv_width;
+ pos.height = (cv_height > 0) ? cv_height : default_cv_height;
DefaultY(&pos);
cv->gw = gw = GDrawCreateTopWindow(NULL,&pos,cv_e_h,cv,&wattrs);
View
@@ -144,8 +144,8 @@ static char *script_filenames[SCRIPT_MENU_MAX];
static char *RecentFiles[RECENT_MAX];
static int ItalicConstrained = true;
extern int clear_tt_instructions_when_needed; /* cvundoes.c */
-static int default_cv_width; /* in charview.c */
-static int default_cv_height; /* in charview.c */
+static int cv_width; /* in charview.c */
+static int cv_height; /* in charview.c */
static int mv_width; /* in metricsview.c */
static int mv_height; /* in metricsview.c */
static int bv_width; /* in bitmapview.c */
@@ -295,8 +295,8 @@ extras[] = {
{ "SeekChar", pr_unicode, &home_char, NULL, NULL, '\0', NULL, 1, NULL },
{ "CompactOnOpen", pr_bool, &compact_font_on_open, NULL, NULL, '\0', NULL, 1, NULL },
{ "PixmapDir", pr_file, &pixmapdir, NULL, NULL, 'R', NULL, 0, NULL },
- { "DefaultCVWidth", pr_int, &default_cv_width, NULL, NULL, '\0', NULL, 1, NULL },
- { "DefaultCVHeight", pr_int, &default_cv_height, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultCVWidth", pr_int, &cv_width, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultCVHeight", pr_int, &cv_height, NULL, NULL, '\0', NULL, 1, NULL },
{ "FCShowHidden", pr_bool, &gfc_showhidden, NULL, NULL, '\0', NULL, 1, NULL },
{ "FCDirPlacement", pr_int, &gfc_dirplace, NULL, NULL, '\0', NULL, 1, NULL },
{ "FCBookmarks", pr_string, &gfc_bookmarks, NULL, NULL, '\0', NULL, 1, NULL },
View
@@ -160,8 +160,8 @@ extern int add_char_to_name_list; /* in charinfo.c */
extern int clear_tt_instructions_when_needed; /* in cvundoes.c */
extern int export_clipboard; /* in cvundoes.c */
extern int prefs_ensure_correct_extension; /* in fontview.c */
-extern int default_cv_width; /* in charview.c */
-extern int default_cv_height; /* in charview.c */
+extern int cv_width; /* in charview.c */
+extern int cv_height; /* in charview.c */
extern int interpCPsOnMotion; /* in charview.c */
extern int DrawOpenPathsWithHighlight; /* in charview.c */
extern int mv_width; /* in metricsview.c */
@@ -428,8 +428,8 @@ static struct prefs_list {
{ "SaveToDir", pr_int, &save_to_dir, NULL, NULL, 'S', NULL, 1, NULL },
{ "OnlyCopyDisplayed", pr_bool, &onlycopydisplayed, NULL, NULL, '\0', NULL, 1, NULL },
{ "PalettesDocked", pr_bool, &palettes_docked, NULL, NULL, '\0', NULL, 1, NULL },
- { "DefaultCVWidth", pr_int, &default_cv_width, NULL, NULL, '\0', NULL, 1, NULL },
- { "DefaultCVHeight", pr_int, &default_cv_height, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultCVWidth", pr_int, &cv_width, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultCVHeight", pr_int, &cv_height, NULL, NULL, '\0', NULL, 1, NULL },
{ "CVVisible0", pr_bool, &cvvisible[0], NULL, NULL, '\0', NULL, 1, NULL },
{ "CVVisible1", pr_bool, &cvvisible[1], NULL, NULL, '\0', NULL, 1, NULL },
{ "BVVisible0", pr_bool, &bvvisible[0], NULL, NULL, '\0', NULL, 1, NULL },

0 comments on commit 50a4d80

Please sign in to comment.