|
Krita Source Code Documentation
|
#include <kis_constrained_rect.h>
Inheritance diagram for KisConstrainedRect:Public Types | |
| enum | HandleType { None = 0 , UpperLeft , UpperRight , LowerLeft , LowerRight , Upper , Lower , Left , Right , Inside , Creation } |
Signals | |
| void | sigLockValuesChanged () |
| void | sigValuesChanged () |
Public Member Functions | |
| bool | canGrow () const |
| bool | centered () const |
| QPointF | handleSnapPoint (HandleType handle, const QPointF &cursorPos) |
| bool | heightLocked () const |
| KisConstrainedRect () | |
| void | moveHandle (HandleType handle, const QPoint &offset, const QRect &oldRect) |
| void | normalize () |
| qreal | ratio () const |
| bool | ratioLocked () const |
| QRect | rect () const |
| void | setCanGrow (bool value) |
| void | setCentered (bool value) |
| void | setCropRect (const QRect &cropRect) |
| void | setHeight (int value) |
| void | setHeightLocked (bool value) |
| void | setOffset (const QPoint &offset) |
| void | setRatio (qreal value) |
| void | setRatioLocked (bool value) |
| void | setRectInitial (const QRect &rect) |
| void | setWidth (int value) |
| void | setWidthLocked (bool value) |
| bool | widthLocked () const |
| ~KisConstrainedRect () override | |
Private Member Functions | |
| void | assignNewSize (const QSize &newSize) |
| int | heightFromWidthUnsignedRatio (int width, qreal ratio, int oldHeight) const |
| void | storeRatioSafe (const QSize &newSize) |
| int | widthFromHeightUnsignedRatio (int height, qreal ratio, int oldWidth) const |
Private Attributes | |
| bool | m_canGrow {true} |
| bool | m_centered {false} |
| QRect | m_cropRect |
| bool | m_heightLocked {false} |
| qreal | m_ratio {1.0} |
| bool | m_ratioLocked {false} |
| QRect | m_rect |
| bool | m_widthLocked {false} |
Definition at line 15 of file kis_constrained_rect.h.
| Enumerator | |
|---|---|
| None | |
| UpperLeft | |
| UpperRight | |
| LowerLeft | |
| LowerRight | |
| Upper | |
| Lower | |
| Left | |
| Right | |
| Inside | |
| Creation | |
Definition at line 20 of file kis_constrained_rect.h.
| KisConstrainedRect::KisConstrainedRect | ( | ) |
Definition at line 14 of file kis_constrained_rect.cpp.
|
override |
Definition at line 18 of file kis_constrained_rect.cpp.
|
private |
Definition at line 361 of file kis_constrained_rect.cpp.
References m_canGrow, m_centered, m_cropRect, m_rect, and sigValuesChanged().
| bool KisConstrainedRect::canGrow | ( | ) | const |
Definition at line 43 of file kis_constrained_rect.cpp.
References m_canGrow.
| bool KisConstrainedRect::centered | ( | ) | const |
Definition at line 36 of file kis_constrained_rect.cpp.
References m_centered.
| QPointF KisConstrainedRect::handleSnapPoint | ( | HandleType | handle, |
| const QPointF & | cursorPos ) |
Definition at line 231 of file kis_constrained_rect.cpp.
References Creation, Inside, Left, Lower, LowerLeft, LowerRight, m_rect, None, Right, Upper, UpperLeft, and UpperRight.
|
private |
Definition at line 389 of file kis_constrained_rect.cpp.
References KisAlgebra2D::copysign(), and ratio().
| bool KisConstrainedRect::heightLocked | ( | ) | const |
| void KisConstrainedRect::moveHandle | ( | HandleType | handle, |
| const QPoint & | offset, | ||
| const QRect & | oldRect ) |
Definition at line 58 of file kis_constrained_rect.cpp.
References KisAlgebra2D::copysign(), Creation, heightFromWidthUnsignedRatio(), heightLocked(), Inside, Left, Lower, LowerLeft, LowerRight, m_canGrow, m_centered, m_cropRect, m_ratio, m_ratioLocked, m_rect, None, ratioLocked(), Right, sigValuesChanged(), storeRatioSafe(), Upper, UpperLeft, UpperRight, widthFromHeightUnsignedRatio(), and widthLocked().
| void KisConstrainedRect::normalize | ( | ) |
Definition at line 271 of file kis_constrained_rect.cpp.
References m_rect, and setRectInitial().
| qreal KisConstrainedRect::ratio | ( | ) | const |
Definition at line 54 of file kis_constrained_rect.cpp.
References m_ratio.
| bool KisConstrainedRect::ratioLocked | ( | ) | const |
Definition at line 401 of file kis_constrained_rect.cpp.
References m_ratioLocked.
| QRect KisConstrainedRect::rect | ( | ) | const |
Definition at line 50 of file kis_constrained_rect.cpp.
References m_rect.
| void KisConstrainedRect::setCanGrow | ( | bool | value | ) |
Definition at line 46 of file kis_constrained_rect.cpp.
| void KisConstrainedRect::setCentered | ( | bool | value | ) |
Definition at line 39 of file kis_constrained_rect.cpp.
References m_centered, and value().
| void KisConstrainedRect::setCropRect | ( | const QRect & | cropRect | ) |
Definition at line 31 of file kis_constrained_rect.cpp.
References m_cropRect.
| void KisConstrainedRect::setHeight | ( | int | value | ) |
Definition at line 343 of file kis_constrained_rect.cpp.
References assignNewSize(), KIS_ASSERT_RECOVER_RETURN, m_ratio, m_rect, ratioLocked(), storeRatioSafe(), and value().
| void KisConstrainedRect::setHeightLocked | ( | bool | value | ) |
Definition at line 412 of file kis_constrained_rect.cpp.
References m_heightLocked, m_ratioLocked, m_widthLocked, sigLockValuesChanged(), and value().
| void KisConstrainedRect::setOffset | ( | const QPoint & | offset | ) |
Definition at line 276 of file kis_constrained_rect.cpp.
References m_canGrow, m_cropRect, m_rect, and sigValuesChanged().
| void KisConstrainedRect::setRatio | ( | qreal | value | ) |
Definition at line 292 of file kis_constrained_rect.cpp.
References assignNewSize(), eps, heightLocked(), KIS_ASSERT_RECOVER_RETURN, m_ratio, m_rect, setHeightLocked(), sigValuesChanged(), value(), and widthLocked().
| void KisConstrainedRect::setRatioLocked | ( | bool | value | ) |
Definition at line 419 of file kis_constrained_rect.cpp.
References m_heightLocked, m_ratioLocked, m_widthLocked, sigLockValuesChanged(), and value().
| void KisConstrainedRect::setRectInitial | ( | const QRect & | rect | ) |
Definition at line 22 of file kis_constrained_rect.cpp.
References m_rect, ratioLocked(), rect(), sigValuesChanged(), and storeRatioSafe().
| void KisConstrainedRect::setWidth | ( | int | value | ) |
Definition at line 325 of file kis_constrained_rect.cpp.
References assignNewSize(), KIS_ASSERT_RECOVER_RETURN, m_ratio, m_rect, ratioLocked(), storeRatioSafe(), and value().
| void KisConstrainedRect::setWidthLocked | ( | bool | value | ) |
Definition at line 405 of file kis_constrained_rect.cpp.
References m_heightLocked, m_ratioLocked, m_widthLocked, sigLockValuesChanged(), and value().
|
signal |
|
signal |
|
private |
Definition at line 378 of file kis_constrained_rect.cpp.
References m_ratio.
|
private |
Definition at line 383 of file kis_constrained_rect.cpp.
References KisAlgebra2D::copysign(), and ratio().
| bool KisConstrainedRect::widthLocked | ( | ) | const |
Definition at line 395 of file kis_constrained_rect.cpp.
References m_widthLocked.
|
private |
Definition at line 83 of file kis_constrained_rect.h.
|
private |
Definition at line 82 of file kis_constrained_rect.h.
|
private |
Definition at line 91 of file kis_constrained_rect.h.
|
private |
Definition at line 88 of file kis_constrained_rect.h.
|
private |
Definition at line 85 of file kis_constrained_rect.h.
|
private |
Definition at line 89 of file kis_constrained_rect.h.
|
private |
Definition at line 84 of file kis_constrained_rect.h.
|
private |
Definition at line 87 of file kis_constrained_rect.h.