Skip to content

Commit

Permalink
fix: Focus region bug when primary workspace zoomed (#1851)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarades authored Aug 10, 2023
1 parent c463a32 commit e7c7d0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugins/workspace-minimap/src/focus_region.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,16 @@ export class FocusRegion {
const primaryMetrics = this.primaryWorkspace.getMetricsManager();
const minimapMetrics = this.minimapWorkspace.getMetricsManager();

const primaryView = primaryMetrics.getViewMetrics();
const primaryContent = primaryMetrics.getContentMetrics();
const primaryView = primaryMetrics.getViewMetrics(true);
const primaryContent = primaryMetrics.getContentMetrics(true);
const minimapContent = minimapMetrics.getContentMetrics();
const minimapSvg = minimapMetrics.getSvgMetrics();

// Return if there is no content.
if (primaryContent.width === 0) {
return;
}

// Get the workscape to pixel scale on the minimap.
const scale = minimapContent.width /
minimapMetrics.getContentMetrics(true).width;
Expand Down
1 change: 1 addition & 0 deletions plugins/workspace-minimap/src/minimap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export class Minimap {
private onClickUp(): void {
if (this.onMouseMoveWrapper) {
Blockly.browserEvents.unbind(this.onMouseMoveWrapper);
this.onMouseMoveWrapper = null;
}
}

Expand Down

0 comments on commit e7c7d0d

Please sign in to comment.