Hi Leong and Taro,
2013/04/02 Tue 20:00:43 UTC+9 KF Leong:
> > Please check your DPI of screen on your both machines, and tell me those.
>
> Aah, yes DPI setting!!
>
> For the NG machine, DPI set to 125%, while OK machine is at default,
> 100%.
Please try this additional patch.
(Sorry If I send this message twice.)
Best regards,
Ken Takata
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
diff --git a/src/gui_dwrite.cpp b/src/gui_dwrite.cpp
--- a/src/gui_dwrite.cpp
+++ b/src/gui_dwrite.cpp
@@ -409,6 +409,7 @@
void DrawText(HDC hdc, const WCHAR* text, int len,
int x, int y, int w, int h, int cellWidth, COLORREF color);
+ float PixelsToDipsX(int x);
float PixelsToDipsY(int y);
void SetRenderingParams(
@@ -670,8 +671,8 @@
BitBlt(memdc, 0, 0, w, h, hdc, x, y, SRCCOPY);
hr = mDWriteFactory->CreateGdiCompatibleTextLayout(
- text, len, mTextFormat, static_cast<FLOAT>(w),
- static_cast<FLOAT>(h), mDpiScaleX, NULL, TRUE, &textLayout);
+ text, len, mTextFormat, PixelsToDipsX(w),
+ PixelsToDipsY(h), mDpiScaleX, NULL, TRUE, &textLayout);
if (SUCCEEDED(hr))
{
@@ -686,7 +687,7 @@
mRenderingParams);
GdiTextRendererContext data = {
color,
- (FLOAT)cellWidth / mDpiScaleX,
+ PixelsToDipsX(cellWidth),
0.0f
};
textLayout->Draw(&data, renderer, 0, 0);
@@ -702,6 +703,12 @@
}
float
+DWriteContext::PixelsToDipsX(int x)
+{
+ return x / mDpiScaleX;
+}
+
+ float
DWriteContext::PixelsToDipsY(int y)
{
return y / mDpiScaleY;