aboutsummaryrefslogtreecommitdiffhomepage
path: root/qt/ScintillaEditBase/PlatQt.cpp
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-03-25 10:57:35 +1100
committerNeil <nyamatongwe@gmail.com>2021-03-25 10:57:35 +1100
commit2f0011955fe7d3ac0b80247abc88ee0461104eb6 (patch)
tree803c13dc6a4cfac883ab488c975149428adebf29 /qt/ScintillaEditBase/PlatQt.cpp
parentfa10779da55ff13c95a0cd39bffdf57dcdfc9cc5 (diff)
downloadscintilla-mirror-2f0011955fe7d3ac0b80247abc88ee0461104eb6.tar.gz
Add FillRectangleAligned to align rectangle to pixel grid on x-axis before
filling it to avoid partially drawn pixels on left and right edges.
Diffstat (limited to 'qt/ScintillaEditBase/PlatQt.cpp')
-rw-r--r--qt/ScintillaEditBase/PlatQt.cpp5
1 files changed, 5 insertions, 0 deletions
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