Skip to content

Commit

Permalink
fix: removed X & Y from toolbox.ts and replaced movBy to moveTo (#7333)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
varshneydevansh committed Aug 4, 2023
1 parent 8241fca commit dbe926d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 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 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';
Expand Down Expand Up @@ -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];
Expand Down
8 changes: 5 additions & 3 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 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';
Expand Down Expand Up @@ -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!,
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions core/utils/toolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ 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 dbe926d

Please sign in to comment.