From c3551f2ab3ffe8faae7d74bb304783959018f8a1 Mon Sep 17 00:00:00 2001 From: cxl Date: Mon, 14 Dec 2015 12:53:34 +0000 Subject: [PATCH] CtrlCore: Fixed DrawLineOp (thanks pvictor) git-svn-id: svn://ultimatepp.org/upp/trunk@9286 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlCore/GtkDrawOp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uppsrc/CtrlCore/GtkDrawOp.cpp b/uppsrc/CtrlCore/GtkDrawOp.cpp index b49d358f6..2305c801a 100644 --- a/uppsrc/CtrlCore/GtkDrawOp.cpp +++ b/uppsrc/CtrlCore/GtkDrawOp.cpp @@ -187,15 +187,15 @@ void SystemDraw::DrawLineOp(int x1, int y1, int x2, int y2, int width, Color col if(width == PEN_SOLID) width = 1; if(y1 == y2 && width >= 0) - DrawRect(x1, y1, x2 - x1, width, color); + DrawRect(x1, y1 - width / 2, x2 - x1, width, color); else if(x1 == x2 && width >= 0) - DrawRect(x1, y1, width, y2 - y1, color); + DrawRect(x1 - width / 2, y1, width, y2 - y1, color); else { int w = width < 0 ? 1 : width; double d = w / 2.0; if(y1 == y2) { - cairo_move_to(cr, min(x1, x1) + 0.5, y1 + d); + cairo_move_to(cr, min(x1, x2) + 0.5, y1 + d); cairo_line_to(cr, max(x1, x2) - 0.5, y1 + d); } else