Revert "fix: removed X & Y from toolbox.ts and replaced movBy to moveTo (#7333)" (#7375)

This reverts commit dbe926db4a.

The reverted commit made it so that RTL flyouts were rendered incorrectly.
This commit is contained in:
Beka Westberg
2023-08-10 13:40:08 -07:00
committed by GitHub
parent 80b1b44540
commit 7bca438ab8
3 changed files with 7 additions and 8 deletions

View File

@@ -19,7 +19,7 @@ import type {FlyoutButton} from './flyout_button.js';
import type {Options} from './options.js'; import type {Options} from './options.js';
import * as registry from './registry.js'; import * as registry from './registry.js';
import {Scrollbar} from './scrollbar.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 {Rect} from './utils/rect.js';
import * as toolbox from './utils/toolbox.js'; import * as toolbox from './utils/toolbox.js';
import * as WidgetDiv from './widgetdiv.js'; import * as WidgetDiv from './widgetdiv.js';
@@ -285,8 +285,7 @@ export class HorizontalFlyout extends Flyout {
} else { } else {
moveX = cursorX - tab; moveX = cursorX - tab;
} }
// No 'reason' provided since events are disabled. block!.moveBy(moveX, cursorY);
block!.moveTo(new Coordinate(moveX, cursorY));
const rect = this.createRect_(block!, moveX, cursorY, blockHW, i); const rect = this.createRect_(block!, moveX, cursorY, blockHW, i);
cursorX += blockHW.width + gaps[i]; cursorX += blockHW.width + gaps[i];

View File

@@ -19,7 +19,7 @@ import type {FlyoutButton} from './flyout_button.js';
import type {Options} from './options.js'; import type {Options} from './options.js';
import * as registry from './registry.js'; import * as registry from './registry.js';
import {Scrollbar} from './scrollbar.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 {Rect} from './utils/rect.js';
import * as toolbox from './utils/toolbox.js'; import * as toolbox from './utils/toolbox.js';
import * as WidgetDiv from './widgetdiv.js'; import * as WidgetDiv from './widgetdiv.js';
@@ -246,8 +246,7 @@ export class VerticalFlyout extends Flyout {
const moveX = block!.outputConnection const moveX = block!.outputConnection
? cursorX - this.tabWidth_ ? cursorX - this.tabWidth_
: cursorX; : cursorX;
// No 'reason' provided since events are disabled. block!.moveBy(moveX, cursorY);
block!.moveTo(new Coordinate(moveX, cursorY));
const rect = this.createRect_( const rect = this.createRect_(
block!, block!,
@@ -358,8 +357,7 @@ export class VerticalFlyout extends Flyout {
if (!block.outputConnection) { if (!block.outputConnection) {
newX -= this.tabWidth_; newX -= this.tabWidth_;
} }
// No 'reason' provided since events are disabled. block.moveBy(newX - oldX, 0);
block.moveTo(new Coordinate(newX - oldX, 0));
} }
if (this.rectMap_.has(block)) { if (this.rectMap_.has(block)) {
this.moveRectToBlock_(this.rectMap_.get(block)!, block); this.moveRectToBlock_(this.rectMap_.get(block)!, block);

View File

@@ -24,6 +24,8 @@ export interface BlockInfo {
disabled?: string | boolean; disabled?: string | boolean;
enabled?: boolean; enabled?: boolean;
id?: string; id?: string;
x?: number;
y?: number;
collapsed?: boolean; collapsed?: boolean;
inline?: boolean; inline?: boolean;
data?: string; data?: string;