Skip to content

Commit

Permalink
Fix: issue in visibility offset
Browse files Browse the repository at this point in the history
  • Loading branch information
Akalanka47000 committed Dec 25, 2024
1 parent 1f37e86 commit 06e1624
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
Changelog

# v3.2.2 [2024-12-25]

## Patch Release

### Fixes
- Fixed an issue when there is no visibility offset

# v3.2.1 [2024-12-18]

## Patch Release
Expand Down
12 changes: 7 additions & 5 deletions src/components/workspace/dock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ import { VisibilityFreezeScale, VisibilityOffset } from "./visibility";

const handleElementVisibility = debounce((workspace, k) => {
const visibilityOffset = +workspace.attr(dataAttributes.visibilityOffset) || 0;
const initialViewBoxScaleForWidth = +workspace.attr(dataAttributes.initialViewBoxScaleForWidth);
if (k * 1.1 < getScaleFactorAccountingForViewBoxWidth(visibilityOffset, initialViewBoxScaleForWidth)) {
showPreOffsetElements();
} else {
showPostOffsetElements();
if (visibilityOffset) {
const initialViewBoxScaleForWidth = +workspace.attr(dataAttributes.initialViewBoxScaleForWidth);
if (k * 1.1 < getScaleFactorAccountingForViewBoxWidth(visibilityOffset, initialViewBoxScaleForWidth)) {
showPreOffsetElements();
} else {
showPostOffsetElements();
}
}
}, 25);

Expand Down

0 comments on commit 06e1624

Please sign in to comment.