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
7
#include "
kis_tool_ellipse_base.h
"
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
17
KisToolEllipseBase::KisToolEllipseBase
(
KoCanvasBase
* canvas,
KisToolEllipseBase::ToolType
type,
const
QCursor & cursor)
18
:
KisToolRectangleBase
(canvas, type, cursor)
19
{
20
}
21
22
void
KisToolEllipseBase::paintRectangle
(QPainter &gc,
const
QRectF &imageRect)
23
{
24
KIS_ASSERT_RECOVER_RETURN
(
canvas
());
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
36
bool
KisToolEllipseBase::showRoundCornersGUI
()
const
37
{
38
return
false
;
39
}
KisViewManager.h
KoCanvasBase.h
KoCanvasController.h
KoPointerEvent.h
KoViewConverter.h
KisToolEllipseBase::KisToolEllipseBase
KisToolEllipseBase(KoCanvasBase *canvas, KisToolEllipseBase::ToolType type, const QCursor &cursor=KisCursor::load("tool_ellipse_cursor.png", 6, 6))
Definition
kis_tool_ellipse_base.cpp:17
KisToolEllipseBase::showRoundCornersGUI
bool showRoundCornersGUI() const override
Definition
kis_tool_ellipse_base.cpp:36
KisToolEllipseBase::paintRectangle
void paintRectangle(QPainter &gc, const QRectF &imageRect) override
Definition
kis_tool_ellipse_base.cpp:22
KisToolRectangleBase
Definition
kis_tool_rectangle_base.h:14
KisToolRectangleBase::m_dragStart
QPointF m_dragStart
Definition
kis_tool_rectangle_base.h:53
KisToolRectangleBase::getRotatedPath
void getRotatedPath(QPainterPath &path, const QPointF ¢er, const qreal &angle)
Definition
kis_tool_rectangle_base.cpp:422
KisToolRectangleBase::drawX
QPainterPath drawX(const QPointF &pt)
Definition
kis_tool_rectangle_base.cpp:415
KisToolRectangleBase::ToolType
ToolType
Definition
kis_tool_rectangle_base.h:29
KisToolRectangleBase::m_dragCenter
QPointF m_dragCenter
Definition
kis_tool_rectangle_base.h:52
KisToolRectangleBase::getRotationAngle
qreal getRotationAngle()
Definition
kis_tool_rectangle_base.cpp:411
KoCanvasBase
Definition
KoCanvasBase.cpp:24
KIS_ASSERT_RECOVER_RETURN
#define KIS_ASSERT_RECOVER_RETURN(cond)
Definition
kis_assert.h:75
kis_canvas2.h
kis_tool_ellipse_base.h
KisTool::pixelToView
QPointF pixelToView(const QPoint &pixelCoord) const
Definition
kis_tool.cc:269
KisTool::paintToolOutline
void paintToolOutline(QPainter *painter, const KisOptimizedBrushOutline &path)
Definition
kis_tool.cc:589
Private::canvas
KisCanvas2 * canvas
Definition
KisFrameDisplayProxy.cpp:22
libs
ui
tool
kis_tool_ellipse_base.cpp
Generated at
2025-11-04 02:30:02+01:00
from
Krita
branch
master
, commit
c9dde2e79561a8aea4a7e8d9ac99c98a7bac9e52