Draw::GetPagePixels, GetPixelsPerInch now return correct values in native mode

git-svn-id: svn://ultimatepp.org/upp/trunk@692 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2008-12-04 16:41:36 +00:00
parent d2937c6c4c
commit ca69ceb571
3 changed files with 7 additions and 9 deletions

View file

@ -493,6 +493,7 @@ protected:
typedef Link<FontInfo::Data, 2> 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; }

View file

@ -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;
}

View file

@ -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;