Skip to content

Commit

Permalink
Remove double-scaling in coordmap.getPanelCss() (#4111)
Browse files Browse the repository at this point in the history
Fixes #4110
  • Loading branch information
jcheng5 committed Jul 31, 2024
1 parent 4bc330e commit 43d36c0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 20 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# shiny (development version)

## Bug fixes

* Fixed a bug introduced in v1.9.0 where the boundaries of hover/click/brush regions on plots were being incorrectly scaled when browser zoom was used. (#4111)

# shiny 1.9.0

## New busy indication feature
Expand Down Expand Up @@ -31,6 +35,7 @@ In addition, various properties of the spinners and pulse can be customized with
* Output bindings that are removed, invalidated, then inserted again (while invalidated) now correctly include the `.recalculating` CSS class. (#4039)

* Fixed a recent issue with `uiOutput()` and `conditionalPanel()` not properly lower opacity when recalculation (in a Bootstrap 5 context). (#4027)

* Image outputs that were scaled by CSS had certain regions that were unresponsive to hover/click/brush handlers. (#3234)

# shiny 1.8.1.1
Expand Down
8 changes: 1 addition & 7 deletions inst/www/shared/shiny.js
Original file line number Diff line number Diff line change
Expand Up @@ -14583,13 +14583,7 @@
var dists = [];
var i5;
for (i5 = 0; i5 < coordmap.panels.length; i5++) {
var panelRange = coordmap.panels[i5].range;
var b3 = {
top: panelRange.top * cssToImgRatio.y,
bottom: panelRange.bottom * cssToImgRatio.y,
left: panelRange.left * cssToImgRatio.x,
right: panelRange.right * cssToImgRatio.x
};
var b3 = coordmap.panels[i5].range;
if (x2 <= b3.right + expandImg.x && x2 >= b3.left - expandImg.x && y4 <= b3.bottom + expandImg.y && y4 >= b3.top - expandImg.y) {
matches.push(coordmap.panels[i5]);
var xdist = 0;
Expand Down
4 changes: 2 additions & 2 deletions inst/www/shared/shiny.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/www/shared/shiny.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions inst/www/shared/shiny.min.js.map

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions srcts/src/imageutils/initCoordmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,7 @@ function initCoordmap(
let i;

for (i = 0; i < coordmap.panels.length; i++) {
const panelRange = coordmap.panels[i].range;
const b = {
top: panelRange.top * cssToImgRatio.y,
bottom: panelRange.bottom * cssToImgRatio.y,
left: panelRange.left * cssToImgRatio.x,
right: panelRange.right * cssToImgRatio.x,
};
const b = coordmap.panels[i].range;

if (
x <= b.right + expandImg.x &&
Expand Down

0 comments on commit 43d36c0

Please sign in to comment.