Always render svg pieces anew on size change
[xboard.git] / dialogs.c
index 7659f5b..42e6379 100644 (file)
--- a/dialogs.c
+++ b/dialogs.c
@@ -753,12 +753,13 @@ static void DefColor P((int n));
 static void AdjustColor P((int i));
 
 static char oldPngDir[MSG_SIZ];
+static char oldSvgDir[MSG_SIZ];
 
 static int
 BoardOptionsOK (int n)
 {
     if(appData.overrideLineGap >= 0) lineGap = appData.overrideLineGap; else lineGap = defaultLineGap;
-    InitDrawingParams(strcmp(oldPngDir, appData.pngDirectory));
+    InitDrawingParams(strcmp(oldPngDir, appData.pngDirectory) || strcmp(oldSvgDir, appData.svgDirectory));
     InitDrawingSizes(-1, 0);
     DrawPosition(True, NULL);
     return 1;
@@ -813,6 +814,7 @@ static Option boardOptions[] = {
 { 0, 0, 0, NULL, (void*) &appData.liteBackTextureFile, ".xpm", NULL, FileName, N_("Light-Squares Texture File:") },
 { 0, 0, 0, NULL, (void*) &appData.darkBackTextureFile, ".xpm", NULL, FileName, N_("Dark-Squares Texture File:") },
 { 0, 0, 0, NULL, (void*) &appData.pngDirectory, "", NULL, PathName, N_("Directory with PNG Pieces:") },
+{ 0, 0, 0, NULL, (void*) &appData.svgDirectory, "", NULL, PathName, N_("Directory with SVG Pieces:") },
 { 0, 0, 0, NULL, (void*) &BoardOptionsOK, "", NULL, EndMark , "" }
 };
 
@@ -862,6 +864,7 @@ void
 BoardOptionsProc ()
 {
    strncpy(oldPngDir, appData.pngDirectory, MSG_SIZ-1); // to see if it changed
+   strncpy(oldSvgDir, appData.svgDirectory, MSG_SIZ-1); // to see if it changed
    GenericPopUp(boardOptions, _("Board Options"), TransientDlg, BoardWindow, MODAL, 0);
 }