mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 05:58:38 +00:00
Fixed size limits of item on big images.
This commit is contained in:
parent
36e5056b59
commit
1504f92a64
@ -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…
x
Reference in New Issue
Block a user