-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input brush isn't properly cleared when new brush is drawn #2197
Comments
@schloerke, @cpsievert and I did some investigation and learned some things. There are three separate issues here. Some code that imports and removes the previous brush is not being calledThis is an issue that was introduced in #2198 (merged this morning). This block of code waits for the image to load, then imports the old brush (and removes the old brush's shiny/srcjs/output_binding_image.js Lines 1032 to 1035 in 1d0edd2
#2198 moved the caller of this code into Each time a brush occurs, the plot is redrawn twice.With
The second looks like this:
So, that's one thing. This causes the server to generate the same exact plot twice. On WebKit (only), an image's
|
@schloerke Temporarily setting |
Actually, better than |
Relevant for the second issue, of the plot being drawn twice because |
Actually three separate issues addressed. Fixes #2197. - brush.importOldBrush() was not being called anymore, due to it being registered as a load handler after the image was already loaded (this was a very recent regression, less than 24 hours old). - Each time the brush changes, the plot is redrawn twice. This was because importing the old brush introduced floating point errors that led to a slightly different new brush being created. - Sometimes the image's load event wasn't firing at all. This is due to behavior in WebKit where assigning an image's src to its existing value is a no-op.
This comment has been minimized.
This comment has been minimized.
I never applied the rounding to 14 digits code to coords_imag and coords_css. So that makes sense. shiny/srcjs/output_binding_image.js Lines 1259 to 1261 in 3cea5fb
|
Observed in RStudio viewer 1.1.456 with v1.2-rc in https://github.com/rstudio/shiny-examples/tree/master/108-module-output
Interestingly, the issue doesn't occur in Chrome (with v1.2-rc), nor does it appear in the viewer with shiny v1.1
The text was updated successfully, but these errors were encountered: