mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 03:53:22 +02:00
Rotate canvas image on client side when necessary. Minicap now always returns the image in upright position for newer devices.
This commit is contained in:
@@ -389,6 +389,17 @@ module.exports = syrup.serial()
|
||||
frameProducer.updateRotation(newRotation)
|
||||
})
|
||||
|
||||
frameProducer.on('start', function() {
|
||||
var message = util.format(
|
||||
'start %s'
|
||||
, JSON.stringify(frameProducer.banner)
|
||||
)
|
||||
|
||||
broadcastSet.values().forEach(function(ws) {
|
||||
ws.send(message)
|
||||
})
|
||||
})
|
||||
|
||||
frameProducer.on('readable', function next() {
|
||||
var frame
|
||||
if ((frame = frameProducer.nextFrame())) {
|
||||
|
||||
@@ -16,7 +16,11 @@ module.exports.read = function parseBanner(out) {
|
||||
, virtualWidth: 0
|
||||
, virtualHeight: 0
|
||||
, orientation: 0
|
||||
, quirks: 0
|
||||
, quirks: {
|
||||
dumb: false
|
||||
, alwaysUpright: false
|
||||
, tear: false
|
||||
}
|
||||
}
|
||||
|
||||
tryRead = function() {
|
||||
@@ -78,7 +82,9 @@ module.exports.read = function parseBanner(out) {
|
||||
break
|
||||
case 23:
|
||||
// quirks
|
||||
banner.quirks = chunk[cursor]
|
||||
banner.quirks.dumb = (chunk[cursor] & 1) === 1
|
||||
banner.quirks.alwaysUpright = (chunk[cursor] & 2) === 2
|
||||
banner.quirks.tear = (chunk[cursor] & 4) === 4
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user