mirror of
https://github.com/fltk/fltk.git
synced 2026-06-01 23:06:54 +08:00
Windows: fix undrawn pixels at right and bottom of scaled windows.
This commit is contained in:
+1
-2
@@ -1265,8 +1265,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||||||
ValidateRgn(hWnd, R2);
|
ValidateRgn(hWnd, R2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert R2 in drawing units to i->region in FLTK units
|
if (scale != 1) DeleteObject(R2);
|
||||||
i->region = Fl_GDI_Graphics_Driver::scale_region(R2, 1 / scale, NULL);
|
|
||||||
|
|
||||||
window->clear_damage((uchar)(window->damage() | FL_DAMAGE_EXPOSE));
|
window->clear_damage((uchar)(window->damage() | FL_DAMAGE_EXPOSE));
|
||||||
// These next two statements should not be here, so that all update
|
// These next two statements should not be here, so that all update
|
||||||
|
|||||||
@@ -246,14 +246,12 @@ void Fl_GDI_Graphics_Driver::scale(float f) {
|
|||||||
|
|
||||||
/* Rescale region r with factor f and returns the scaled region.
|
/* Rescale region r with factor f and returns the scaled region.
|
||||||
Region r is returned unchanged if r is null or f is 1.
|
Region r is returned unchanged if r is null or f is 1.
|
||||||
The input region is deleted if dr is null.
|
|
||||||
*/
|
*/
|
||||||
HRGN Fl_GDI_Graphics_Driver::scale_region(HRGN r, float f, Fl_GDI_Graphics_Driver *dr) {
|
HRGN Fl_GDI_Graphics_Driver::scale_region(HRGN r, float f, Fl_GDI_Graphics_Driver *dr) {
|
||||||
if (r && f != 1) {
|
if (r && f != 1) {
|
||||||
DWORD size = GetRegionData(r, 0, NULL);
|
DWORD size = GetRegionData(r, 0, NULL);
|
||||||
RGNDATA *pdata = (RGNDATA*)malloc(size);
|
RGNDATA *pdata = (RGNDATA*)malloc(size);
|
||||||
GetRegionData(r, size, pdata);
|
GetRegionData(r, size, pdata);
|
||||||
if (!dr) DeleteObject(r);
|
|
||||||
POINT pt = {0, 0};
|
POINT pt = {0, 0};
|
||||||
if (dr && dr->depth >= 1) { // account for translation
|
if (dr && dr->depth >= 1) { // account for translation
|
||||||
GetWindowOrgEx((HDC)dr->gc(), &pt);
|
GetWindowOrgEx((HDC)dr->gc(), &pt);
|
||||||
|
|||||||
Reference in New Issue
Block a user