diff --git a/uppsrc/Draw/Draw.h b/uppsrc/Draw/Draw.h index 24fea8c35..5699d98b0 100644 --- a/uppsrc/Draw/Draw.h +++ b/uppsrc/Draw/Draw.h @@ -493,6 +493,7 @@ protected: typedef Link FontLink; + Size pageDots; Size pagePixels; Size pageMMs; Size inchPixels; @@ -636,12 +637,9 @@ public: bool PaletteMode() const { return palette; } bool IsMono() const { return is_mono; } - Size GetPagePixels() const { return pagePixels; } -// Size GetPageDots() const { return pagePixels; } + Size GetPagePixels() const { return native ? pagePixels : pageDots; } + Size GetPixelsPerInch() const { return native ? nativeDpi : inchPixels; } Size GetPageMMs() const { return pageMMs; } - Size GetPixelsPerInch() const { return inchPixels; } -// Size GetSheetPixels() const { return sheetPixels; } -// Point GetPageOffset() const { return pageOffset; } bool Pixels() const { return pixels; } bool Dots() const { return !pixels; } diff --git a/uppsrc/Draw/DrawWin32.cpp b/uppsrc/Draw/DrawWin32.cpp index 91cfa840f..260198644 100644 --- a/uppsrc/Draw/DrawWin32.cpp +++ b/uppsrc/Draw/DrawWin32.cpp @@ -224,7 +224,7 @@ void Draw::LoadCaps() { palette = (GetDeviceCaps(handle, RASTERCAPS) & RC_PALETTE); if(palette) color16 = GetDeviceCaps(handle, SIZEPALETTE) != 256; - pagePixels = GetSizeCaps(HORZRES, VERTRES); + pageDots = pagePixels = GetSizeCaps(HORZRES, VERTRES); pageMMs = GetSizeCaps(HORZSIZE, VERTSIZE); nativeDpi = inchPixels = GetSizeCaps(LOGPIXELSX, LOGPIXELSY); sheetPixels = GetSizeCaps(PHYSICALWIDTH, PHYSICALHEIGHT); @@ -410,8 +410,8 @@ void PrintDraw::InitPrinter() DotsMode(); native = 0; actual_offset = Point(0, 0); - pagePixels.cx = 600 * pagePixels.cx / inchPixels.cx; - pagePixels.cy = 600 * pagePixels.cy / inchPixels.cy; + pageDots.cx = 600 * pagePixels.cx / inchPixels.cx; + pageDots.cy = 600 * pagePixels.cy / inchPixels.cy; inchPixels.cx = 600; inchPixels.cy = 600; } diff --git a/uppsrc/Draw/DrawX11.cpp b/uppsrc/Draw/DrawX11.cpp index 688771e21..83b7092f6 100644 --- a/uppsrc/Draw/DrawX11.cpp +++ b/uppsrc/Draw/DrawX11.cpp @@ -341,7 +341,7 @@ void Draw::SetLineStyle(int width) void Draw::Init() { DrawLock __; - pagePixels = Size(Xwidth, Xheight); + pageDots = pagePixels = Size(Xwidth, Xheight); pageMMs = Size(XwidthMM, XheightMM); nativeDpi = inchPixels = 254 * pagePixels / pageMMs / 10; sheetPixels = pagePixels;