Skip to content

Commit

Permalink
Move variables
Browse files Browse the repository at this point in the history
  • Loading branch information
thsparks committed Oct 18, 2023
1 parent 1f56f2f commit 8da311f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions webapp/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ export class ProjectView
private rootClasses: string[];
private pendingImport: pxt.Util.DeferredPromise<void>;

private tutorialFontIncrement = 0.25;
private tutorialInitialFontSize = 1.125; // rem

private highContrastSubscriber: data.DataSubscriber = {
subscriptions: [],
onDataChanged: () => {
Expand Down Expand Up @@ -1535,14 +1538,11 @@ export class ProjectView
}
}

zoomIncrement = 0.25; // TODO thsparks : move up.
initialFontSize = 1.125; // TODO thsparks : move up. Can this reference the css?

onScaleChanged(oldScale: number, newScale: number) {
if (this.isTutorial && oldScale !== newScale) {
const change = newScale > oldScale ? this.zoomIncrement : -this.zoomIncrement;
const change = newScale > oldScale ? this.tutorialFontIncrement : -this.tutorialFontIncrement;
if (!this.state.tutorialFontSize) {
this.setState({ tutorialFontSize: this.initialFontSize + change });
this.setState({ tutorialFontSize: this.tutorialInitialFontSize + change });
} else {
this.setState({ tutorialFontSize: this.state.tutorialFontSize + change });
}
Expand Down

0 comments on commit 8da311f

Please sign in to comment.