Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: chrome/content/ui/sendReport.js

Issue 29333400: Issue 3503 - Fixed: Screenshot marker in Issue Reporter is no longer red (Closed)
Patch Set: Better approach, remove asynchronity Created Jan. 12, 2016, 4:22 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/child/dataCollector.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/ui/sendReport.js
===================================================================
--- a/chrome/content/ui/sendReport.js
+++ b/chrome/content/ui/sendReport.js
@@ -354,36 +354,32 @@ var screenshotDataSource =
setData: function(screenshot)
{
let canvas = E("screenshotCanvas");
// Do not resize canvas any more (no idea why Gecko requires both to be set)
canvas.parentNode.style.MozBoxAlign = "center";
canvas.parentNode.align = "center";
- // Init canvas settings
let context = canvas.getContext("2d");
- context.fillStyle = "rgb(0, 0, 0)";
- context.strokeStyle = "rgba(255, 0, 0, 0.7)";
- context.lineWidth = 3;
- context.lineJoin = "round";
-
this._canvas = canvas;
this._context = context;
if (screenshot)
{
- let image = new Image();
- image.src = screenshot;
- image.addEventListener("load", () => {
- canvas.width = image.width + this.imageOffset * 2;
- canvas.height = image.height + this.imageOffset * 2;
- context.drawImage(image, this.imageOffset, this.imageOffset);
- });
+ canvas.width = screenshot.width + this.imageOffset * 2;
+ canvas.height = screenshot.height + this.imageOffset * 2;
+ context.putImageData(screenshot, this.imageOffset, this.imageOffset);
}
+
+ // Init canvas settings
+ context.fillStyle = "rgb(0, 0, 0)";
+ context.strokeStyle = "rgba(255, 0, 0, 0.7)";
+ context.lineWidth = 3;
+ context.lineJoin = "round";
},
get enabled()
{
return this._enabled
},
set enabled(enabled)
{
« no previous file with comments | « no previous file | lib/child/dataCollector.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld