Skip to content

Commit 1fc4cbc

Browse files
committed
frontend/pinch-to-zoom: fix "first" for whiteboard, missing import in latex actions
1 parent 71e933f commit 1fc4cbc

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/packages/frontend/frame-editors/frame-tree/pinch-to-zoom.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ document.addEventListener("gestureend", handler);
4343

4444
export interface Data {
4545
fontSize: number;
46+
first?: boolean;
4647
}
4748

4849
const pinchMax = 1000;
@@ -70,9 +71,9 @@ export default function usePinchToZoom({
7071

7172
const saveThrottled = useMemo(() => {
7273
if (disabled) return () => {};
73-
return throttle((fontSize, _first) => {
74+
return throttle((fontSize, first) => {
7475
if (onZoom != null) {
75-
onZoom({ fontSize });
76+
onZoom({ fontSize, first });
7677
return;
7778
}
7879
actions.set_font_size(id, fontSize);

src/packages/frontend/frame-editors/latex-editor/actions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ import {
8787
ScrollIntoViewRecord,
8888
} from "./types";
8989
import { ensureTargetPathIsCorrect, pdf_path } from "./util";
90+
import * as tree_ops from "../frame-tree/tree-ops";
9091

9192
interface LatexEditorState extends CodeEditorState {
9293
build_logs: BuildLogs;
@@ -1444,7 +1445,7 @@ export class Actions extends BaseActions<LatexEditorState> {
14441445
const tree = this._get_tree();
14451446
const leaf_ids = tree_ops.get_leaf_ids(tree);
14461447

1447-
for (const id of leaf_ids) {
1448+
for (const id in leaf_ids) {
14481449
const node = tree_ops.get_node(tree, id);
14491450
if (node && node.get("type") === type) {
14501451
return id;

src/packages/frontend/frame-editors/whiteboard-editor/canvas.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ export default function Canvas({
12771277
}
12781278

12791279
if (selectedTool == "pen") {
1280-
// mousePath is used for the actual path when creating the elemnts,
1280+
// mousePath is used for the actual path when creating the elements,
12811281
// and is in data coordinates:
12821282
const point = getMousePos(e);
12831283
if (point == null) return;

0 commit comments

Comments
 (0)