On Tue, Apr 17, 2012 at 9:00 AM, <[email protected]> wrote:
> * the context passed to the mozPrintCallback function has a `canvas` > property. I think this `canvas` property should not exist on the > mozPrintCallback passed in `ctx` and should return `undefined. > > What should this canvas be? If it's the canvas of the print-document, > performing operations like `appendChild` to the HTML tree, that gets > printed, can cause issues, as it's assumed that this tree is static and > can't change. On the other side, the `canvas` might refer to the canvas in > the DOM, but this canvas was removed in the meantime (= during the time > frame the printing starts and the callback is called) maybe . > Good thought, but I think it's fine for it to be the canvas in the page DOM. If that canvas has been removed from the document, that's OK. * The current implementation sets the size of the rendering context to the > size of the actual canvas on the screen if in preview. The canvas context > is then scaled, such that the behavior of the canvas context "feels" the > same in normal DOM usage. While this works, this might cause problems when > using `getImageData` on the canvas. > > Imagine the print preview has a zoom set to 10%. If the canvas has > normally a width of 100px, it might now only have 10px in preview. The > internal used context of the canvas is then only 10px in width, but if the > user requests imageData with width 50px, this gets mapped down to 5px (due > to internal scaling). But then the 5px gets scaled by factor 10 to get the > 50px of the imageData size. As a result, the imageData the user gets might > not be of the quality it is used to be. > For high quality, we need an extended version of get/putImageData that can work at higher resolution. To solve this, should the canvas context size be at least the size of the > canvas.width/canvas.height as specified in the DOM? I don't think we need to do that. Rob -- “You have heard that it was said, ‘Love your neighbor and hate your enemy.’ But I tell you, love your enemies and pray for those who persecute you, that you may be children of your Father in heaven. ... If you love those who love you, what reward will you get? Are not even the tax collectors doing that? And if you greet only your own people, what are you doing more than others?" [Matthew 5:43-47] _______________________________________________ dev-tech-layout mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-layout

