Skip to content

Commit

Permalink
scale history
Browse files Browse the repository at this point in the history
  • Loading branch information
kleber-swf committed Sep 2, 2021
1 parent 609697d commit f5f6d1b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/scene/selection/scale/scale.handler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Data, DataOrigin } from 'data/data';
import { History } from 'data/history';
import { ScaleGizmo } from './scale.gizmo';
import { Scaler } from './scaler';

Expand Down Expand Up @@ -54,13 +55,23 @@ export class ScaleHandler extends Phaser.Group {
}

private startScaling(gizmos: ScaleGizmo) {
const obj = Data.selectedObject;
History.holdEntry({
obj,
properties: {
scale: obj.scale.clone(),
position: obj.position.clone(),
},
});

this.scaler.startScaling(this.selectedObject, gizmos.factorH, gizmos.factorV);
this._scaling = true;
}

private stopScaling() {
this._scaling = false;
this.scaler.stopScaling();
History.commit();
}

public handle() {
Expand Down

0 comments on commit f5f6d1b

Please sign in to comment.