Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_tool_ellipse_base.cpp
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2009 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
8
9#include <KoPointerEvent.h>
10#include <KoCanvasBase.h>
11#include <KoCanvasController.h>
12#include <KoViewConverter.h>
13#include "KisViewManager.h"
14
15#include "kis_canvas2.h"
16
18 : KisToolRectangleBase(canvas, type, cursor)
19{
20}
21
22void KisToolEllipseBase::paintRectangle(QPainter &gc, const QRectF &imageRect)
23{
25
26 QRect viewRect = pixelToView(imageRect).toRect();
27
28 QPainterPath path;
29 path.addEllipse(viewRect);
30 getRotatedPath(path, viewRect.center(), getRotationAngle());
31 path.addPath(drawX(pixelToView(m_dragStart)));
32 path.addPath(drawX(pixelToView(m_dragCenter)));
33 paintToolOutline(&gc, path);
34}
35
37{
38 return false;
39}
KisToolEllipseBase(KoCanvasBase *canvas, KisToolEllipseBase::ToolType type, const QCursor &cursor=KisCursor::load("tool_ellipse_cursor.png", 6, 6))
bool showRoundCornersGUI() const override
void paintRectangle(QPainter &gc, const QRectF &imageRect) override
void getRotatedPath(QPainterPath &path, const QPointF &center, const qreal &angle)
QPainterPath drawX(const QPointF &pt)
#define KIS_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:75
QPointF pixelToView(const QPoint &pixelCoord) const
Definition kis_tool.cc:269
void paintToolOutline(QPainter *painter, const KisOptimizedBrushOutline &path)
Definition kis_tool.cc:589
KisCanvas2 * canvas