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

* fix: removed X & Y from toolbox.ts and replaced movBy to moveTo in Horizontal/ Vertical flyout

* forget to run npm lint and format

* removed the mistakenly added comment
This commit is contained in:
देवांश वार्ष्णेय
2023-08-04 21:17:30 +05:30
committed by GitHub
parent 8241fca23f
commit dbe926db4a
3 changed files with 8 additions and 7 deletions

View File

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

View File

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