mirror of
https://github.com/rstudio/shiny.git
synced 2026-01-11 07:58:11 -05:00
Retina display compatibility
This commit is contained in:
@@ -112,7 +112,8 @@ renderPlot <- function(expr, width='auto', height='auto', res=72, ...,
|
||||
log = c(
|
||||
x = par('xlog'),
|
||||
y = par('ylog')
|
||||
)
|
||||
),
|
||||
pixelratio = pixelratio
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1013,17 +1013,16 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Account for retina
|
||||
// TODO: Account for scrolling within the image??
|
||||
|
||||
function devToUsrX(deviceX) {
|
||||
var x = deviceX - coordmap.bounds.left;
|
||||
var x = (deviceX * coordmap.pixelratio) - coordmap.bounds.left;
|
||||
var factor = (coordmap.usr.right - coordmap.usr.left) /
|
||||
(coordmap.bounds.right - coordmap.bounds.left);
|
||||
return (x * factor) + coordmap.usr.left;
|
||||
}
|
||||
function devToUsrY(deviceY) {
|
||||
var y = deviceY - coordmap.bounds.bottom;
|
||||
var y = (deviceY * coordmap.pixelratio) - coordmap.bounds.bottom;
|
||||
var factor = (coordmap.usr.top - coordmap.usr.bottom) /
|
||||
(coordmap.bounds.top - coordmap.bounds.bottom);
|
||||
return (y * factor) + coordmap.usr.bottom;
|
||||
|
||||
Reference in New Issue
Block a user