Skip to content

Commit

Permalink
fix: scaling using shortcuts should not exceed limit
Browse files Browse the repository at this point in the history
Fixes zooming issue mentioned in FlashpointProject#437
  • Loading branch information
dot-mike committed Dec 14, 2024
1 parent edd7654 commit 275084a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/renderer/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ export class Footer extends React.Component<FooterProps> {
*/
setScaleSliderValue(scale: number): void {
if (this.scaleSliderRef.current) {
const value = Math.min(Math.max(0, scale), 1) * Footer.scaleSliderMax;
this.scaleSliderRef.current.value = value + '';
if (scale < 0) { scale = 0; }
else if (scale > 1) { scale = 1; }
this.scaleSliderRef.current.value = (Math.min(Math.max(0, scale), 1) * Footer.scaleSliderMax).toFixed(1).toString();
updatePreferencesData({ browsePageGameScale: scale });
}
}
Expand Down

0 comments on commit 275084a

Please sign in to comment.