diff options
-rw-r--r-- | cocoa/PlatCocoa.h | 1 | ||||
-rw-r--r-- | cocoa/PlatCocoa.mm | 6 | ||||
-rwxr-xr-x | gtk/PlatGTK.cxx | 5 | ||||
-rw-r--r-- | qt/ScintillaEditBase/PlatQt.cpp | 5 | ||||
-rw-r--r-- | qt/ScintillaEditBase/PlatQt.h | 1 | ||||
-rw-r--r-- | src/Platform.h | 1 | ||||
-rw-r--r-- | win32/PlatWin.cxx | 10 |
7 files changed, 29 insertions, 0 deletions
diff --git a/cocoa/PlatCocoa.h b/cocoa/PlatCocoa.h index 29a3626ce..1df4e0458 100644 --- a/cocoa/PlatCocoa.h +++ b/cocoa/PlatCocoa.h @@ -105,6 +105,7 @@ public: void RectangleFrame(PRectangle rc, Stroke stroke) override; void FillRectangle(PRectangle rc, ColourDesired back) override; void FillRectangle(PRectangle rc, Fill fill) override; + void FillRectangleAligned(PRectangle rc, Fill fill) override; void FillRectangle(PRectangle rc, Surface &surfacePattern) override; void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back) override; void RoundedRectangle(PRectangle rc, FillStroke fillStroke) override; diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 275587288..ef8a3f518 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -811,6 +811,12 @@ void SurfaceImpl::FillRectangle(PRectangle rc, Fill fill) { //-------------------------------------------------------------------------------------------------- +void SurfaceImpl::FillRectangleAligned(PRectangle rc, Fill fill) { + FillRectangle(PixelAlign(rc, PixelDivisions()), fill); +} + +//-------------------------------------------------------------------------------------------------- + static void drawImageRefCallback(void *info, CGContextRef gc) { CGImageRef pattern = static_cast<CGImageRef>(info); CGContextDrawImage(gc, CGRectMake(0, 0, CGImageGetWidth(pattern), CGImageGetHeight(pattern)), pattern); diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 5296691d1..1732c217e 100755 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -172,6 +172,7 @@ public: void RectangleFrame(PRectangle rc, Stroke stroke) override; void FillRectangle(PRectangle rc, ColourDesired back) override; void FillRectangle(PRectangle rc, Fill fill) override; + void FillRectangleAligned(PRectangle rc, Fill fill) override; void FillRectangle(PRectangle rc, Surface &surfacePattern) override; void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back) override; void RoundedRectangle(PRectangle rc, FillStroke fillStroke) override; @@ -592,6 +593,10 @@ void SurfaceImpl::FillRectangle(PRectangle rc, Fill fill) { } } +void SurfaceImpl::FillRectangleAligned(PRectangle rc, Fill fill) { + FillRectangle(PixelAlign(rc, 1), fill); +} + void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern) { SurfaceImpl &surfi = dynamic_cast<SurfaceImpl &>(surfacePattern); if (context && surfi.psurf) { diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index 120b75052..f2681013a 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -380,6 +380,11 @@ void SurfaceImpl::FillRectangle(PRectangle rc, Fill fill) GetPainter()->fillRect(QRectFFromPRect(rc), QColorFromColourAlpha(fill.colour)); } +void SurfaceImpl::FillRectangleAligned(PRectangle rc, Fill fill) +{ + FillRectangle(PixelAlign(rc, 1), fill); +} + void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern) { // Tile pattern over rectangle diff --git a/qt/ScintillaEditBase/PlatQt.h b/qt/ScintillaEditBase/PlatQt.h index ac4bb9a69..b579ee3f3 100644 --- a/qt/ScintillaEditBase/PlatQt.h +++ b/qt/ScintillaEditBase/PlatQt.h @@ -115,6 +115,7 @@ public: void RectangleFrame(PRectangle rc, Stroke stroke) override; void FillRectangle(PRectangle rc, ColourDesired back) override; void FillRectangle(PRectangle rc, Fill fill) override; + void FillRectangleAligned(PRectangle rc, Fill fill) override; void FillRectangle(PRectangle rc, Surface &surfacePattern) override; void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back) override; diff --git a/src/Platform.h b/src/Platform.h index 3b9443cc9..568c571cc 100644 --- a/src/Platform.h +++ b/src/Platform.h @@ -205,6 +205,7 @@ public: virtual void RectangleFrame(PRectangle rc, Stroke stroke)=0; virtual void FillRectangle(PRectangle rc, ColourDesired back)=0; virtual void FillRectangle(PRectangle rc, Fill fill)=0; + virtual void FillRectangleAligned(PRectangle rc, Fill fill)=0; virtual void FillRectangle(PRectangle rc, Surface &surfacePattern)=0; virtual void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back)=0; virtual void RoundedRectangle(PRectangle rc, FillStroke fillStroke)=0; diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index c902bad04..65a024565 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -497,6 +497,7 @@ public: void RectangleFrame(PRectangle rc, Stroke stroke) override; void FillRectangle(PRectangle rc, ColourDesired back) override; void FillRectangle(PRectangle rc, Fill fill) override; + void FillRectangleAligned(PRectangle rc, Fill fill) override; void FillRectangle(PRectangle rc, Surface &surfacePattern) override; void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back) override; void RoundedRectangle(PRectangle rc, FillStroke fillStroke) override; @@ -770,6 +771,10 @@ void SurfaceGDI::FillRectangle(PRectangle rc, Fill fill) { } } +void SurfaceGDI::FillRectangleAligned(PRectangle rc, Fill fill) { + FillRectangle(PixelAlign(rc, 1), fill); +} + void SurfaceGDI::FillRectangle(PRectangle rc, Surface &surfacePattern) { HBRUSH br; if (SurfaceGDI *psgdi = dynamic_cast<SurfaceGDI *>(&surfacePattern); psgdi && psgdi->bitmap) { @@ -1453,6 +1458,7 @@ public: void RectangleFrame(PRectangle rc, Stroke stroke) override; void FillRectangle(PRectangle rc, ColourDesired back) override; void FillRectangle(PRectangle rc, Fill fill) override; + void FillRectangleAligned(PRectangle rc, Fill fill) override; void FillRectangle(PRectangle rc, Surface &surfacePattern) override; void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back) override; void RoundedRectangle(PRectangle rc, FillStroke fillStroke) override; @@ -1879,6 +1885,10 @@ void SurfaceD2D::FillRectangle(PRectangle rc, Fill fill) { } } +void SurfaceD2D::FillRectangleAligned(PRectangle rc, Fill fill) { + FillRectangle(PixelAlign(rc, 1), fill); +} + void SurfaceD2D::FillRectangle(PRectangle rc, Surface &surfacePattern) { SurfaceD2D *psurfOther = dynamic_cast<SurfaceD2D *>(&surfacePattern); PLATFORM_ASSERT(psurfOther); |