Skip to content

Commit e5bfbdd

Browse files
BeksOmegaericblackmonGoogle
authored andcommitted
Revert "fix: removed X & Y from toolbox.ts and replaced movBy to moveTo (#7333)" (#7375)
This reverts commit dbe926d. The reverted commit made it so that RTL flyouts were rendered incorrectly. (cherry picked from commit 7bca438)
1 parent 8cbc7ed commit e5bfbdd

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

core/flyout_horizontal.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import type {FlyoutButton} from './flyout_button.js';
1919
import type {Options} from './options.js';
2020
import * as registry from './registry.js';
2121
import {Scrollbar} from './scrollbar.js';
22-
import {Coordinate} from './utils/coordinate.js';
22+
import type {Coordinate} from './utils/coordinate.js';
2323
import {Rect} from './utils/rect.js';
2424
import * as toolbox from './utils/toolbox.js';
2525
import * as WidgetDiv from './widgetdiv.js';
@@ -285,8 +285,7 @@ export class HorizontalFlyout extends Flyout {
285285
} else {
286286
moveX = cursorX - tab;
287287
}
288-
// No 'reason' provided since events are disabled.
289-
block!.moveTo(new Coordinate(moveX, cursorY));
288+
block!.moveBy(moveX, cursorY);
290289

291290
const rect = this.createRect_(block!, moveX, cursorY, blockHW, i);
292291
cursorX += blockHW.width + gaps[i];

core/flyout_vertical.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import type {FlyoutButton} from './flyout_button.js';
1919
import type {Options} from './options.js';
2020
import * as registry from './registry.js';
2121
import {Scrollbar} from './scrollbar.js';
22-
import {Coordinate} from './utils/coordinate.js';
22+
import type {Coordinate} from './utils/coordinate.js';
2323
import {Rect} from './utils/rect.js';
2424
import * as toolbox from './utils/toolbox.js';
2525
import * as WidgetDiv from './widgetdiv.js';
@@ -246,8 +246,7 @@ export class VerticalFlyout extends Flyout {
246246
const moveX = block!.outputConnection
247247
? cursorX - this.tabWidth_
248248
: cursorX;
249-
// No 'reason' provided since events are disabled.
250-
block!.moveTo(new Coordinate(moveX, cursorY));
249+
block!.moveBy(moveX, cursorY);
251250

252251
const rect = this.createRect_(
253252
block!,
@@ -358,8 +357,7 @@ export class VerticalFlyout extends Flyout {
358357
if (!block.outputConnection) {
359358
newX -= this.tabWidth_;
360359
}
361-
// No 'reason' provided since events are disabled.
362-
block.moveTo(new Coordinate(newX - oldX, 0));
360+
block.moveBy(newX - oldX, 0);
363361
}
364362
if (this.rectMap_.has(block)) {
365363
this.moveRectToBlock_(this.rectMap_.get(block)!, block);

core/utils/toolbox.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export interface BlockInfo {
2424
disabled?: string | boolean;
2525
enabled?: boolean;
2626
id?: string;
27+
x?: number;
28+
y?: number;
2729
collapsed?: boolean;
2830
inline?: boolean;
2931
data?: string;

0 commit comments

Comments
 (0)