diff options
Diffstat (limited to 'qt')
-rw-r--r-- | qt/ScintillaEditBase/PlatQt.cpp | 16 | ||||
-rw-r--r-- | qt/ScintillaEditBase/PlatQt.h | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index 7e2fd3e98..120b75052 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -301,6 +301,22 @@ void SurfaceImpl::LineTo(int x_, int y_) y = y_; } +void SurfaceImpl::LineDraw(Point start, Point end, Stroke stroke) +{ + PenColourWidth(stroke.colour, stroke.width); + QLineF line(start.x, start.y, end.x, end.y); + GetPainter()->drawLine(line); +} + +void SurfaceImpl::PolyLine(const Point *pts, size_t npts, Stroke stroke) +{ + // TODO: set line joins and caps + PenColourWidth(stroke.colour, stroke.width); + std::vector<QPointF> qpts; + std::transform(pts, pts + npts, std::back_inserter(qpts), QPointFFromPoint); + GetPainter()->drawPolyline(&qpts[0], static_cast<int>(npts)); +} + void SurfaceImpl::Polygon(Point *pts, size_t npts, ColourDesired fore, diff --git a/qt/ScintillaEditBase/PlatQt.h b/qt/ScintillaEditBase/PlatQt.h index a95e1bd88..ac4bb9a69 100644 --- a/qt/ScintillaEditBase/PlatQt.h +++ b/qt/ScintillaEditBase/PlatQt.h @@ -104,6 +104,8 @@ public: int DeviceHeightFont(int points) override; void MoveTo(int x_, int y_) override; void LineTo(int x_, int y_) override; + void LineDraw(Point start, Point end, Stroke stroke) override; + void PolyLine(const Point *pts, size_t npts, Stroke stroke) override; void Polygon(Point *pts, size_t npts, ColourDesired fore, ColourDesired back) override; void Polygon(const Point *pts, size_t npts, FillStroke fillStroke) override; |