|
Krita Source Code Documentation
|
#include <SelectionDecorator.h>
Public Member Functions | |
| void | paint (QPainter &painter, const KoViewConverter &converter) |
| SelectionDecorator (KoCanvasResourceProvider *resourceManager) | |
| void | setCurrentMeshGradientHandles (const KoShapeMeshGradientHandles::Handle &selectedHandle, const KoShapeMeshGradientHandles::Handle &hoveredHandle) |
| void | setDecorationThickness (int thickness) |
| void | setForceShapeOutlines (bool value) |
| void | setHandleRadius (int radius) |
| void | setSelection (KoSelection *selection) |
| void | setShowFillGradientHandles (bool value) |
| void | setShowFillMeshGradientHandles (bool value) |
| void | setShowStrokeFillGradientHandles (bool value) |
| ~SelectionDecorator () | |
Private Member Functions | |
| void | paintGradientHandles (KoShape *shape, KoFlake::FillVariant fillVariant, QPainter &painter, const KoViewConverter &converter) |
| void | paintMeshGradientHandles (KoShape *shape, KoFlake::FillVariant fillVariant, QPainter &painter, const KoViewConverter &converter) |
Private Attributes | |
| KoShapeMeshGradientHandles::Handle | m_currentHoveredMeshHandle |
| int | m_decorationThickness {1} |
| bool | m_forceShapeOutlines {false} |
| int | m_handleRadius {7} |
| KoFlake::AnchorPosition | m_hotPosition |
| KoShapeMeshGradientHandles::Handle | m_selectedMeshHandle |
| KoSelection * | m_selection {nullptr} |
| bool | m_showFillGradientHandles {false} |
| bool | m_showFillMeshGradientHandles {false} |
| bool | m_showStrokeFillGradientHandles {false} |
The SelectionDecorator is used to paint extra user-interface items on top of a selection.
Definition at line 29 of file SelectionDecorator.h.
| SelectionDecorator::SelectionDecorator | ( | KoCanvasResourceProvider * | resourceManager | ) |
Constructor.
| arrows | the direction that needs highlighting. (currently unused) |
| rotationHandles | if true; the rotation handles will be drawn |
| shearHandles | if true; the shearhandles will be drawn |
Definition at line 34 of file SelectionDecorator.cpp.
References KoFlake::HotPosition, m_hotPosition, and KoCanvasResourceProvider::resource().
|
inline |
Definition at line 39 of file SelectionDecorator.h.
| void SelectionDecorator::paint | ( | QPainter & | painter, |
| const KoViewConverter & | converter ) |
paint the decorations.
| painter | the painter to paint to. |
| converter | to convert between internal and view coordinates. |
Definition at line 84 of file SelectionDecorator.cpp.
References KoFlake::anchorToPoint(), KoShape::createHandlePainterHelperView(), KisHandlePainterHelper::drawHandleRect(), KisHandlePainterHelper::drawRubberLine(), KoFlake::Fill, KisHandleStyle::highlightedPrimaryHandles(), KoShape::isShapeEditable(), KoShape::linearizeSubtree(), m_decorationThickness, m_forceShapeOutlines, m_handleRadius, m_hotPosition, m_selection, m_showFillGradientHandles, m_showFillMeshGradientHandles, m_showStrokeFillGradientHandles, KoShape::outline(), KoShape::outlineRect(), KoSelection::outlineRect(), paintGradientHandles(), paintMeshGradientHandles(), KisHandleStyle::primarySelection(), KisHandleStyle::secondarySelection(), KoSelection::selectedEditableShapes(), KoSelection::selectedVisibleShapes(), KisHandlePainterHelper::setHandleStyle(), and KoFlake::StrokeFill.
|
private |
Definition at line 180 of file SelectionDecorator.cpp.
References KoShape::absoluteTransformation(), KoShape::createHandlePainterHelperView(), KisHandlePainterHelper::drawGradientArrow(), KisHandlePainterHelper::drawGradientCrossHandle(), KisHandlePainterHelper::drawGradientHandle(), KisHandleStyle::gradientArrows(), KisHandleStyle::gradientHandles(), KoShapeGradientHandles::handles(), KIS_SAFE_ASSERT_RECOVER_NOOP, m_decorationThickness, m_handleRadius, KoShapeGradientHandles::Handle::RadialCenter, KisHandlePainterHelper::setHandleStyle(), and KoShapeGradientHandles::type().
|
private |
Definition at line 210 of file SelectionDecorator.cpp.
References KoShape::absoluteTransformation(), KoShapeMeshGradientHandles::Handle::BezierHandle, KoShapeMeshGradientHandles::Handle::Corner, KoShape::createHandlePainterHelperView(), KisHandlePainterHelper::drawConnectionLine(), KisHandlePainterHelper::drawHandleCircle(), KisHandlePainterHelper::drawHandleRect(), KisHandlePainterHelper::drawHandleSmallCircle(), KisHandlePainterHelper::drawPath(), KoShapeMeshGradientHandles::getAttachedCorner(), KoShapeMeshGradientHandles::getConnectedPath(), KoShapeMeshGradientHandles::getHandle(), KoShapeMeshGradientHandles::Handle::getPosition(), KoShapeMeshGradientHandles::handles(), KisHandleStyle::highlightedPrimaryHandlesWithSolidOutline(), m_currentHoveredMeshHandle, m_decorationThickness, m_handleRadius, m_selectedMeshHandle, KoShapeMeshGradientHandles::Handle::None, KoShapeMeshGradientHandles::path(), KoShapeMeshGradientHandles::Handle::pos, KisHandleStyle::secondarySelection(), KisHandlePainterHelper::setHandleStyle(), and KoShapeMeshGradientHandles::Handle::type.
| void SelectionDecorator::setCurrentMeshGradientHandles | ( | const KoShapeMeshGradientHandles::Handle & | selectedHandle, |
| const KoShapeMeshGradientHandles::Handle & | hoveredHandle ) |
Definition at line 77 of file SelectionDecorator.cpp.
References m_currentHoveredMeshHandle, and m_selectedMeshHandle.
| void SelectionDecorator::setDecorationThickness | ( | int | thickness | ) |
set the thickness of decoration lines, used for HiDPI support.
| thickness | – the new thickness |
Definition at line 57 of file SelectionDecorator.cpp.
References m_decorationThickness.
| void SelectionDecorator::setForceShapeOutlines | ( | bool | value | ) |
Definition at line 252 of file SelectionDecorator.cpp.
References m_forceShapeOutlines, and value().
| void SelectionDecorator::setHandleRadius | ( | int | radius | ) |
set the radius of the selection handles
| radius | the new handle radius |
Definition at line 52 of file SelectionDecorator.cpp.
References m_handleRadius.
| void SelectionDecorator::setSelection | ( | KoSelection * | selection | ) |
set the selection that is to be painted.
| selection | the current selection. |
Definition at line 47 of file SelectionDecorator.cpp.
References m_selection.
| void SelectionDecorator::setShowFillGradientHandles | ( | bool | value | ) |
Set true if you want to render gradient handles on the canvas. Default value: false
Definition at line 62 of file SelectionDecorator.cpp.
References m_showFillGradientHandles, and value().
| void SelectionDecorator::setShowFillMeshGradientHandles | ( | bool | value | ) |
Definition at line 72 of file SelectionDecorator.cpp.
References m_showFillMeshGradientHandles, and value().
| void SelectionDecorator::setShowStrokeFillGradientHandles | ( | bool | value | ) |
Set true if you want to render gradient handles on the canvas. Default value: false
Definition at line 67 of file SelectionDecorator.cpp.
References m_showStrokeFillGradientHandles, and value().
|
private |
Definition at line 92 of file SelectionDecorator.h.
|
private |
Definition at line 95 of file SelectionDecorator.h.
|
private |
Definition at line 99 of file SelectionDecorator.h.
|
private |
Definition at line 94 of file SelectionDecorator.h.
|
private |
Definition at line 90 of file SelectionDecorator.h.
|
private |
Definition at line 93 of file SelectionDecorator.h.
|
private |
Definition at line 91 of file SelectionDecorator.h.
|
private |
Definition at line 96 of file SelectionDecorator.h.
|
private |
Definition at line 98 of file SelectionDecorator.h.
|
private |
Definition at line 97 of file SelectionDecorator.h.