Skip to content

Commit

Permalink
BoundingBox: add new scale option
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Jul 31, 2024
1 parent 6fb5e49 commit 75af034
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/core/Boxes/boundingbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,11 @@ void BoundingBox::scale(const qreal scaleXBy, const qreal scaleYBy) {
mTransformAnimator->scale(scaleXBy, scaleYBy);
}

void BoundingBox::scaleBy(const qreal scale)
{
mTransformAnimator->setScale(scale, scale);
}

void BoundingBox::rotateBy(const qreal rot) {
mTransformAnimator->rotateRelativeToSavedValue(rot);
}
Expand Down
1 change: 1 addition & 0 deletions src/core/Boxes/boundingbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ class CORE_EXPORT BoundingBox : public eBoxOrSound {
void rotateBy(const qreal rot);
void scale(const qreal scaleBy);
void scale(const qreal scaleXBy, const qreal scaleYBy);
void scaleBy(const qreal scale);
void saveTransformPivotAbsPos(const QPointF &absPivot);

void startPosTransform();
Expand Down
2 changes: 1 addition & 1 deletion src/core/canvasselectedboxesactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ void Canvas::scaleSelectedBoxesStartAndFinish(const qreal scaleBy)
if (mDocument.fLocalPivot) {
for(const auto &box : mSelectedBoxes) {
box->startScaleTransform();
box->scale(scaleBy);
box->scaleBy(scaleBy);
box->finishTransform();
}
} else {
Expand Down

0 comments on commit 75af034

Please sign in to comment.