mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Fixed size limits of item on big images.
This commit is contained in:
parent
36e5056b59
commit
1504f92a64
2 changed files with 10 additions and 2 deletions
|
@ -74,6 +74,10 @@ ItemBase::ItemBase(
|
|||
_scaledHandleSize,
|
||||
_scaledHandleSize,
|
||||
_scaledHandleSize) * 0.5;
|
||||
_sizeLimits = {
|
||||
.min = int(st::photoEditorItemMinSize / zoom),
|
||||
.max = int(st::photoEditorItemMaxSize / zoom),
|
||||
};
|
||||
}, _lifetime);
|
||||
}
|
||||
|
||||
|
@ -124,8 +128,8 @@ void ItemBase::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
|||
prepareGeometryChange();
|
||||
_horizontalSize = std::clamp(
|
||||
(dx > dy ? dx : dy),
|
||||
st::photoEditorItemMinSize,
|
||||
st::photoEditorItemMaxSize);
|
||||
_sizeLimits.min,
|
||||
_sizeLimits.max);
|
||||
updateVerticalSize();
|
||||
}
|
||||
|
||||
|
|
|
@ -90,6 +90,10 @@ private:
|
|||
|
||||
base::unique_qptr<Ui::PopupMenu> _menu;
|
||||
|
||||
struct {
|
||||
int min = 0.;
|
||||
int max = 0.;
|
||||
} _sizeLimits;
|
||||
float64 _scaledHandleSize = 1.0;
|
||||
QMarginsF _scaledInnerMargins;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue