Script Debugger: Scale script text according to DPI scaling

and scale the breakpoint dots accordingly - now they don't looked all
squashed anymore.

I think ResizeImageList() is more correct now, at least this helped with
the breakpoint dots.
This commit is contained in:
Daniel Gibson 2021-07-16 02:19:27 +02:00
parent c3d77abd2b
commit 21f1ba3161

View file

@ -868,7 +868,8 @@ void rvDebuggerWindow::ResizeImageList(int& widthOut, int& heightOut)
GetTextMetrics(dc, &tm);
int height = mZoomScaleDem ? (tm.tmHeight * (float)mZoomScaleNum / (float)mZoomScaleDem) : 16;
int width = mZoomScaleDem ? (s16 * (float)mZoomScaleNum / (float)mZoomScaleDem) : 16;
height *= scaling_factor;
int width = mZoomScaleDem ? (s16 * (float)mZoomScaleNum / (float)mZoomScaleDem) : s16;
ImageList_Destroy(mTmpImageList);
mTmpImageList = ImageList_Create(width, height, ILC_COLOR | ILC_MASK , 0, 2);
@ -915,7 +916,7 @@ int rvDebuggerWindow::HandleCreate ( WPARAM wparam, LPARAM lparam )
dc = GetDC ( mWndScript );
GetTextMetrics ( dc, &tm );
ZeroMemory ( &lf, sizeof(lf) );
lf.lfHeight = tm.tmHeight;
lf.lfHeight = tm.tmHeight * Win_GetWindowScalingFactor( mWndScript );
strcpy ( lf.lfFaceName, "Courier New" );
SendMessage ( mWndScript, WM_SETFONT, (WPARAM)CreateFontIndirect ( &lf ), 0 );