aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/animationtimeline
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/animationtimeline')
-rw-r--r--src/client/views/animationtimeline/Timeline.tsx16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/client/views/animationtimeline/Timeline.tsx b/src/client/views/animationtimeline/Timeline.tsx
index 295c1e18c..677267ca0 100644
--- a/src/client/views/animationtimeline/Timeline.tsx
+++ b/src/client/views/animationtimeline/Timeline.tsx
@@ -372,6 +372,18 @@ export class Timeline extends React.Component<FieldViewProps> {
this.changeCurrentBarX(currCurrent);
}
+
+ resetView(doc: Doc) {
+ doc._panX = doc._customOriginX ?? 0;
+ doc._panY = doc._customOriginY ?? 0;
+ doc.scale = doc._customOriginScale ?? 1;
+ }
+
+ setView(doc: Doc) {
+ doc._customOriginX = doc._panX;
+ doc._customOriginY = doc._panY;
+ doc._customOriginScale = doc.scale;
+ }
/**
* zooming mechanism (increment and spacing changes)
*/
@@ -455,8 +467,8 @@ export class Timeline extends React.Component<FieldViewProps> {
</div>
<div className="time-box overview-tool" style={{ display: this._timelineVisible ? "flex" : "none" }}>
{this.timeIndicator(lengthString, totalTime)}
- <div className="resetView-tool" title="Return to Default View" onClick={() => Doc.resetView(this.props.Document)}><FontAwesomeIcon icon="compress-arrows-alt" size="lg" /></div>
- <div className="resetView-tool" style={{ display: this._isAuthoring ? "flex" : "none" }} title="Set Default View" onClick={() => Doc.setView(this.props.Document)}><FontAwesomeIcon icon="expand-arrows-alt" size="lg" /></div>
+ <div className="resetView-tool" title="Return to Default View" onClick={() => this.resetView(this.props.Document)}><FontAwesomeIcon icon="compress-arrows-alt" size="lg" /></div>
+ <div className="resetView-tool" style={{ display: this._isAuthoring ? "flex" : "none" }} title="Set Default View" onClick={() => this.setView(this.props.Document)}><FontAwesomeIcon icon="expand-arrows-alt" size="lg" /></div>
</div>
</div>