aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2015-03-15 10:09:49 +1100
committerNeil <nyamatongwe@gmail.com>2015-03-15 10:09:49 +1100
commitc4902facfd630c9bb4e47374f4547c43d4912970 (patch)
tree1b80e7b32c1ec48b2899a3353d0d6383ac2a0193 /win32
parent4cc22d416e9e5c4efc0b567b7385e589dd285191 (diff)
downloadscintilla-mirror-c4902facfd630c9bb4e47374f4547c43d4912970.tar.gz
Bug [#1705]. Fix a bug with Mingw-w64. Probably due to incorrect definition of
DWRITE_TEXT_METRICS struct in header.
Diffstat (limited to 'win32')
-rw-r--r--win32/PlatWin.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 3fdfc6065..37724ced8 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -1793,12 +1793,13 @@ XYPOSITION SurfaceD2D::AverageCharWidth(Font &font_) {
// Create a layout
IDWriteTextLayout *pTextLayout = 0;
const WCHAR wszAllAlpha[] = L"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
- HRESULT hr = pIDWriteFactory->CreateTextLayout(wszAllAlpha, static_cast<UINT32>(wcslen(wszAllAlpha)),
+ const size_t lenAllAlpha = wcslen(wszAllAlpha);
+ HRESULT hr = pIDWriteFactory->CreateTextLayout(wszAllAlpha, static_cast<UINT32>(lenAllAlpha),
pTextFormat, 1000.0, 1000.0, &pTextLayout);
if (SUCCEEDED(hr)) {
DWRITE_TEXT_METRICS textMetrics;
if (SUCCEEDED(pTextLayout->GetMetrics(&textMetrics)))
- width = textMetrics.width / wcslen(wszAllAlpha);
+ width = textMetrics.width / lenAllAlpha;
pTextLayout->Release();
}
}