mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
Start to add canvas auto-scaling for retina.
This commit is contained in:
@@ -38,6 +38,7 @@ module.exports = function DeviceScreenDirective($document, ScalingService,
|
||||
, w: 0
|
||||
, h: 0
|
||||
}
|
||||
, autoScaleForRetina: true
|
||||
}
|
||||
|
||||
var cachedScreen = {
|
||||
@@ -59,7 +60,7 @@ module.exports = function DeviceScreenDirective($document, ScalingService,
|
||||
|
||||
function setDisplayDensity(forRetina) {
|
||||
// FORCE
|
||||
forRetina = 1.2
|
||||
forRetina = 1.5
|
||||
|
||||
guestDisplayDensity = BrowserInfo.retina ? forRetina : 1
|
||||
return guestDisplayDensity
|
||||
@@ -199,6 +200,11 @@ module.exports = function DeviceScreenDirective($document, ScalingService,
|
||||
if (scope.$parent.showScreen) {
|
||||
screen.rotation = device.display.rotation
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Check to set the size only if updated
|
||||
if (cachedScreen.bounds.w !== screen.bounds.w ||
|
||||
cachedScreen.bounds.h !== screen.bounds.h ||
|
||||
|
||||
Reference in New Issue
Block a user