Skip to content

Commit

Permalink
Revert "fix: removed X & Y from toolbox.ts and replaced movBy to move…
Browse files Browse the repository at this point in the history
…To (#7333)" (#7375)

This reverts commit dbe926d.

The reverted commit made it so that RTL flyouts were rendered incorrectly.
  • Loading branch information
BeksOmega committed Aug 10, 2023
1 parent 80b1b44 commit 7bca438
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions core/flyout_horizontal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type {FlyoutButton} from './flyout_button.js';
import type {Options} from './options.js';
import * as registry from './registry.js';
import {Scrollbar} from './scrollbar.js';
import {Coordinate} from './utils/coordinate.js';
import type {Coordinate} from './utils/coordinate.js';
import {Rect} from './utils/rect.js';
import * as toolbox from './utils/toolbox.js';
import * as WidgetDiv from './widgetdiv.js';
Expand Down Expand Up @@ -285,8 +285,7 @@ export class HorizontalFlyout extends Flyout {
} else {
moveX = cursorX - tab;
}
// No 'reason' provided since events are disabled.
block!.moveTo(new Coordinate(moveX, cursorY));
block!.moveBy(moveX, cursorY);

const rect = this.createRect_(block!, moveX, cursorY, blockHW, i);
cursorX += blockHW.width + gaps[i];
Expand Down
8 changes: 3 additions & 5 deletions core/flyout_vertical.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type {FlyoutButton} from './flyout_button.js';
import type {Options} from './options.js';
import * as registry from './registry.js';
import {Scrollbar} from './scrollbar.js';
import {Coordinate} from './utils/coordinate.js';
import type {Coordinate} from './utils/coordinate.js';
import {Rect} from './utils/rect.js';
import * as toolbox from './utils/toolbox.js';
import * as WidgetDiv from './widgetdiv.js';
Expand Down Expand Up @@ -246,8 +246,7 @@ export class VerticalFlyout extends Flyout {
const moveX = block!.outputConnection
? cursorX - this.tabWidth_
: cursorX;
// No 'reason' provided since events are disabled.
block!.moveTo(new Coordinate(moveX, cursorY));
block!.moveBy(moveX, cursorY);

const rect = this.createRect_(
block!,
Expand Down Expand Up @@ -358,8 +357,7 @@ export class VerticalFlyout extends Flyout {
if (!block.outputConnection) {
newX -= this.tabWidth_;
}
// No 'reason' provided since events are disabled.
block.moveTo(new Coordinate(newX - oldX, 0));
block.moveBy(newX - oldX, 0);
}
if (this.rectMap_.has(block)) {
this.moveRectToBlock_(this.rectMap_.get(block)!, block);
Expand Down
2 changes: 2 additions & 0 deletions core/utils/toolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export interface BlockInfo {
disabled?: string | boolean;
enabled?: boolean;
id?: string;
x?: number;
y?: number;
collapsed?: boolean;
inline?: boolean;
data?: string;
Expand Down

0 comments on commit 7bca438

Please sign in to comment.