summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/filedialogimpl-win32.cpp
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2017-03-02 00:31:34 +0000
committerEduard Braun <eduard.braun2@gmx.de>2017-03-02 00:31:34 +0000
commitfbc0a45a367964c20f4164a0256343082ebc0a80 (patch)
tree75fb1eb00b425e674c28d2a95a0573db1548f348 /src/ui/dialog/filedialogimpl-win32.cpp
parentFix for native Windows file open dialog only showing the first character of t... (diff)
downloadinkscape-fbc0a45a367964c20f4164a0256343082ebc0a80.tar.gz
inkscape-fbc0a45a367964c20f4164a0256343082ebc0a80.zip
Add units (px) to size being shown in native Windows file open dialog and fix wrong size being shown for EMF/WMF files
(bzr r15560)
Diffstat (limited to 'src/ui/dialog/filedialogimpl-win32.cpp')
-rw-r--r--src/ui/dialog/filedialogimpl-win32.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp
index 7bc9a848c..1efec7d52 100644
--- a/src/ui/dialog/filedialogimpl-win32.cpp
+++ b/src/ui/dialog/filedialogimpl-win32.cpp
@@ -1234,17 +1234,8 @@ bool FileOpenDialogImplWin32::set_emf_preview()
const double emfWidth = w;
const double emfHeight = h;
- // Find the minimum scale to fit the image inside the preview area
- const double scaleFactorX = PreviewSize / emfWidth;
- const double scaleFactorY = PreviewSize / emfHeight;
- const double scaleFactor = (scaleFactorX > scaleFactorY) ? scaleFactorY : scaleFactorX;
-
- // Now get the resized values
- const double scaledEmfWidth = scaleFactor * emfWidth;
- const double scaledEmfHeight = scaleFactor * emfHeight;
-
- _preview_document_width = scaledEmfWidth;
- _preview_document_height = scaledEmfHeight;
+ _preview_document_width = emfWidth / 2540 * 96; // width is in units of 0.01 mm
+ _preview_document_height = emfHeight / 2540 * 96; // height is in units of 0.01 mm
_preview_image_width = emfWidth;
_preview_image_height = emfHeight;
@@ -1494,7 +1485,7 @@ int FileOpenDialogImplWin32::format_caption(wchar_t *caption, int caption_size)
_wsplitpath(_path_string, NULL, NULL, szFileName, NULL);
return snwprintf(caption, caption_size,
- L"%ls\n%d kB\n%d \xD7 %d", szFileName, _preview_file_size,
+ L"%ls\n%d\u2009kB\n%d\u2009px \xD7 %d\u2009px", szFileName, _preview_file_size,
(int)_preview_document_width, (int)_preview_document_height);
}