aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/ScintillaWin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r--win32/ScintillaWin.cxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index 9b1d640f2..cd56105d0 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -286,7 +286,7 @@ class ScintillaWin :
unsigned int linesPerScroll; ///< Intellimouse support
int wheelDelta; ///< Wheel delta from roll
- UINT dpi = 72;
+ UINT dpi = USER_DEFAULT_SCREEN_DPI;
HRGN hRgnUpdate;
@@ -658,8 +658,8 @@ bool ScintillaWin::DragThreshold(Point ptStart, Point ptNow) {
const Point ptDifference = ptStart - ptNow;
const XYPOSITION xMove = std::trunc(std::abs(ptDifference.x));
const XYPOSITION yMove = std::trunc(std::abs(ptDifference.y));
- return (xMove > ::GetSystemMetrics(SM_CXDRAG)) ||
- (yMove > ::GetSystemMetrics(SM_CYDRAG));
+ return (xMove > SystemMetricsForDpi(SM_CXDRAG, dpi)) ||
+ (yMove > SystemMetricsForDpi(SM_CYDRAG, dpi));
}
void ScintillaWin::StartDrag() {
@@ -2824,13 +2824,8 @@ void ScintillaWin::ImeStartComposition() {
int sizeZoomed = vs.styles[styleHere].size + vs.zoomLevel * SC_FONT_SIZE_MULTIPLIER;
if (sizeZoomed <= 2 * SC_FONT_SIZE_MULTIPLIER) // Hangs if sizeZoomed <= 1
sizeZoomed = 2 * SC_FONT_SIZE_MULTIPLIER;
- AutoSurface surface(this);
- int deviceHeight = sizeZoomed;
- if (surface) {
- deviceHeight = (sizeZoomed * surface->LogPixelsY()) / 72;
- }
// The negative is to allow for leading
- lf.lfHeight = -(std::abs(deviceHeight / SC_FONT_SIZE_MULTIPLIER));
+ lf.lfHeight = -::MulDiv(sizeZoomed, dpi, 72*SC_FONT_SIZE_MULTIPLIER);
lf.lfWeight = vs.styles[styleHere].weight;
lf.lfItalic = vs.styles[styleHere].italic ? 1 : 0;
lf.lfCharSet = DEFAULT_CHARSET;