1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
/* This file is part of the KDE project
* SPDX-FileCopyrightText: 2009 Boudewijn Rempt <boud@valdyas.org>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "kis_tool_ellipse_base.h"
#include <KoPointerEvent.h>
#include <KoCanvasBase.h>
#include <KoCanvasController.h>
#include <KoViewConverter.h>
#include "KisViewManager.h"
#include "kis_canvas2.h"
KisToolEllipseBase::KisToolEllipseBase(KoCanvasBase * canvas, KisToolEllipseBase::ToolType type, const QCursor & cursor)
: KisToolRectangleBase(canvas, type, cursor)
{
}
void KisToolEllipseBase::paintRectangle(QPainter &gc, const QRectF &imageRect)
{
KIS_ASSERT_RECOVER_RETURN(canvas());
QRect viewRect = pixelToView(imageRect).toRect();
QPainterPath path;
path.addEllipse(viewRect);
getRotatedPath(path, viewRect.center(), getRotationAngle());
path.addPath(drawX(pixelToView(m_dragStart)));
path.addPath(drawX(pixelToView(m_dragCenter)));
paintToolOutline(&gc, path);
}
bool KisToolEllipseBase::showRoundCornersGUI() const
{
return false;
}
|