diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx index 5c236aed2..37dbadda9 100644 --- a/scintilla/src/Editor.cxx +++ b/scintilla/src/Editor.cxx @@ -1813,10 +1813,10 @@ Sci::Position Editor::FormatRange(bool draw, const Sci_RangeToFormat *pfr) { if (!pfr) return 0; - AutoSurface surface(pfr->hdc, this, SC_TECHNOLOGY_DEFAULT); + AutoSurface surface(pfr->hdc, this, SC_TECHNOLOGY_DEFAULT, true); if (!surface) return 0; - AutoSurface surfaceMeasure(pfr->hdcTarget, this, SC_TECHNOLOGY_DEFAULT); + AutoSurface surfaceMeasure(pfr->hdcTarget, this, SC_TECHNOLOGY_DEFAULT, true); if (!surfaceMeasure) { return 0; } diff --git a/scintilla/src/Editor.h b/scintilla/src/Editor.h index 2fa7ba961..24b2a8cd2 100644 --- a/scintilla/src/Editor.h +++ b/scintilla/src/Editor.h @@ -655,10 +655,10 @@ public: surf->SetBidiR2L(ed->BidirectionalR2L()); } } - AutoSurface(SurfaceID sid, Editor *ed, int technology = -1) { + AutoSurface(SurfaceID sid, Editor *ed, int technology = -1, bool printing = false) { if (ed->wMain.GetID()) { surf.reset(Surface::Allocate(technology != -1 ? technology : ed->technology)); - surf->Init(sid, ed->wMain.GetID()); + surf->Init(sid, ed->wMain.GetID(), printing); surf->SetUnicodeMode(SC_CP_UTF8 == ed->CodePage()); //~surf->SetDBCSMode(ed->CodePage()); surf->SetBidiR2L(ed->BidirectionalR2L()); diff --git a/scintilla/win32/PlatWin.cxx b/scintilla/win32/PlatWin.cxx index db3241870..29719461f 100644 --- a/scintilla/win32/PlatWin.cxx +++ b/scintilla/win32/PlatWin.cxx @@ -573,7 +573,7 @@ public: ~SurfaceGDI() noexcept override; void Init(WindowID wid) noexcept override; - void Init(SurfaceID sid, WindowID wid, bool printing) noexcept override; + void Init(SurfaceID sid, WindowID wid, bool printing = false) noexcept override; void InitPixMap(int width, int height, Surface *surface_, WindowID wid) noexcept override; void Release() noexcept override; @@ -668,7 +668,7 @@ void SurfaceGDI::Init(WindowID wid) noexcept { ::SetTextAlign(hdc, TA_BASELINE); } -void SurfaceGDI::Init(SurfaceID sid, WindowID wid, bool printing) noexcept { +void SurfaceGDI::Init(SurfaceID sid, WindowID wid, bool printing /*=false*/) noexcept { Release(); hdc = static_cast(sid); // Windows on screen are scaled but printers are not. @@ -1343,9 +1343,9 @@ void SurfaceD2D::Init(WindowID wid) noexcept { logPixelsY = DpiYForWindow(wid); } -void SurfaceD2D::Init(SurfaceID sid, WindowID wid, bool /*printing*/) noexcept { +void SurfaceD2D::Init(SurfaceID sid, WindowID wid, bool printing /*=false*/) noexcept { Release(); - // printing always using GDI + // printing always using GDI technology logPixelsY = DpiYForWindow(wid); pRenderTarget = static_cast(sid); }