Skip to content

Commit

Permalink
Merge pull request #150 from NDLANO/fix/label-position-when-zoomed-in…
Browse files Browse the repository at this point in the history
…to-static-scene

fix: label position when zoomed into static scene
  • Loading branch information
otacke authored Apr 17, 2024
2 parents 61edc4d + cdb49fa commit 9f7b8dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/components/Interactions/NavigationButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ export default class NavigationButton extends React.Component {
navButtonFocused={this.state.innerButtonFocused}
rendered={this.props.rendered}
onDoubleClick={this.onDoubleClick.bind(this)}
zoomScale={this.props.zoomScale}
/>}

</div>
Expand Down
8 changes: 8 additions & 0 deletions scripts/components/Interactions/NavigationButtonLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@ export default class NavigationButtonLabel extends React.Component {
* Set expand properties.
*/
setExpandProperties() {
/*
* Only set expand properties when not zoomed in to avoid
* labels toggling when moving image within the wrapper.
*/
if (this.props.zoomScale !== 1) {
return;
}

const labelProperties = this.getOverflowProperties();

if (labelProperties.expandDirection !== this.state.expandDirection) {
Expand Down

0 comments on commit 9f7b8dc

Please sign in to comment.