Showing the changes to libraries/script-engine/src/CanvasCommand.cpp (1 of 4 files). Show all
Unified · Split
| @@ -35,7 +35,7 @@ const QString CMD_TYPE_PROP_NAME = "type"; · 34 unmodified lines | |||
| 35 | 35 | ||
| 36 | const QString IMG_WIDTH_PROP_NAME = "width"; | 36 | const QString IMG_WIDTH_PROP_NAME = "width"; |
| 37 | const QString IMG_HEIGHT_PROP_NAME = "height"; | 37 | const QString IMG_HEIGHT_PROP_NAME = "height"; |
| 38 | const QString IMG_BUFFER_PROP_NAME = "buffer"; | 38 | const QString IMG_DATA_PROP_NAME = "data"; |
| 39 | 39 | ||
| 40 | ScriptValue canvasCommandToScriptValue(ScriptEngine* engine, const CanvasCommand& cmd) { | 40 | ScriptValue canvasCommandToScriptValue(ScriptEngine* engine, const CanvasCommand& cmd) { |
| 41 | using Variant = CanvasCommand::Variant; | 41 | using Variant = CanvasCommand::Variant; |
| @@ -350,14 +350,14 @@ ScriptValue canvasImageToScriptValue(ScriptEngine* engine, const CanvasImage& im · 308 unmodified lines | |||
| 350 | ScriptValue obj = engine->newObject(); | 350 | ScriptValue obj = engine->newObject(); |
| 351 | obj.setProperty(IMG_WIDTH_PROP_NAME, img.width); | 351 | obj.setProperty(IMG_WIDTH_PROP_NAME, img.width); |
| 352 | obj.setProperty(IMG_HEIGHT_PROP_NAME, img.height); | 352 | obj.setProperty(IMG_HEIGHT_PROP_NAME, img.height); |
| 353 | obj.setProperty(IMG_BUFFER_PROP_NAME, qBytearrayToScriptValue(engine, img.buffer)); | 353 | obj.setProperty(IMG_DATA_PROP_NAME, qBytearrayToScriptValue(engine, img.buffer)); |
| 354 | return obj; | 354 | return obj; |
| 355 | } | 355 | } |
| 356 | 356 | ||
| 357 | bool canvasImageFromScriptValue(const ScriptValue& object, CanvasImage& img) { | 357 | bool canvasImageFromScriptValue(const ScriptValue& object, CanvasImage& img) { |
| 358 | img.width = object.property(IMG_WIDTH_PROP_NAME).toInt32(); | 358 | img.width = object.property(IMG_WIDTH_PROP_NAME).toInt32(); |
| 359 | img.height = object.property(IMG_HEIGHT_PROP_NAME).toInt32(); | 359 | img.height = object.property(IMG_HEIGHT_PROP_NAME).toInt32(); |
| 360 | return qBytearrayFromScriptValue(object.property(IMG_BUFFER_PROP_NAME), img.buffer); | 360 | return qBytearrayFromScriptValue(object.property(IMG_DATA_PROP_NAME), img.buffer); |
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | CanvasImage canvasImageFromScriptValue(const ScriptValue& object) { | 363 | CanvasImage canvasImageFromScriptValue(const ScriptValue& object) { |