Last Comment Bug 306752 - drawImage clips the image instead of positioning it on the correct x and y coordinates
: drawImage clips the image instead of positioning it on the correct x and y co...
Status: RESOLVED FIXED
: fixed1.8
Product: Core
Classification: Components
Component: Canvas: 2D (show other bugs)
: Trunk
: x86 Windows XP
: -- normal (vote)
: ---
Assigned To: Vladimir Vukicevic [:vlad] [:vladv]
:
: Milan Sreckovic [:milan]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-01 12:54 PDT by Kamiel Martinet
Modified: 2005-10-26 11:40 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Testcase (581 bytes, text/html)
2005-09-01 12:57 PDT, Kamiel Martinet
no flags Details
Testcase result (17.59 KB, image/png)
2005-09-01 13:40 PDT, Kamiel Martinet
no flags Details
Expected results? (12.96 KB, image/png)
2005-09-01 21:30 PDT, Gérard Talbot
no flags Details
canvas-image-offset-fix.patch (1.78 KB, patch)
2005-10-08 13:44 PDT, Vladimir Vukicevic [:vlad] [:vladv]
tor: review+
asa: approval1.8rc1+
Details | Diff | Splinter Review

Description Kamiel Martinet 2005-09-01 12:54:12 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050901 Firefox/1.6a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050901 Firefox/1.6a1

when I try to place an image on the canvas using de drawImage method, instead of
positioning the image on the correct x and y coordinates, the image gets clipped
x pixels from the left and y pixels from the top.

Reproducible: Always

Steps to Reproduce:
1.see attachment
2 [review].
3.

Actual Results:  
The image gets clipped 30 pixels from the left and 30 from the top

Expected Results:  
Image should be placed 30 pixels from the left and 30 from the top
Comment 1 Kamiel Martinet 2005-09-01 12:57:49 PDT
Created attachment 194571 [details]
Testcase
Comment 2 Kamiel Martinet 2005-09-01 13:40:14 PDT
Created attachment 194579 [details]
Testcase result

The result I get when I run the testcase
Comment 3 Scott MacGregor 2005-09-01 17:27:12 PDT
Using an 09/01 branch Windows build, I see no clipping on the image. It is
properly offset 30 pixels by 30 pixels. 

You reported this bug using a 1.6a1 build. Please see if these problems are on
branch builds before marking them as branch blockers. 

Triage team: This nomination should be removed, I belive this is trunk only.
Comment 4 Gérard Talbot 2005-09-01 21:28:54 PDT
I get what I would believe to be the expected results with Deer Park alpha 2 rv:
1.8b4 build 20050901 under XP Pro SP2 here. WFM 

Screenshot coming.
Comment 5 Gérard Talbot 2005-09-01 21:30:42 PDT
Created attachment 194633 [details]
Expected results?

Screenshot (top left corner only) when using Deer Park alpha 2 rv: 1.8b4 build
20050901 under XP Pro SP2.
Comment 6 Gérard Talbot 2005-09-01 21:36:48 PDT
> You reported this bug using a 1.6a1 build. Please see if these problems are on
> branch builds before marking them as branch blockers. 

Kamiel, you can not request a blocking flag on the branch if you can not see or
have someone reproduce the layout problem on the branch to begin with.

As far as I can see and say, the image is rendered accordingly, as expected in
1.8b4 build 20050901.
Comment 7 Vladimir Vukicevic [:vlad] [:vladv] 2005-09-01 23:18:59 PDT
I'm pretty sure this is being caused by the new way the CTM is handled for
pattern sources by cairo.  It's trunk-only; the cairo used on the branch still
does things the "old way".  I'll take care of it on the trunk in a little bit;
canvas will get rewritten to use thebes, and i'll just do it as part of that.
Comment 8 Kamiel Martinet 2005-10-08 04:07:57 PDT
It seems the branch builds now also suffer from this same bug. Tested with
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b5) Gecko/20051007
Firefox/1.4.1. 

Vladimir, Are the branch builds now also using the 'new way' of drawing images?
Comment 9 Vladimir Vukicevic [:vlad] [:vladv] 2005-10-08 13:44:13 PDT
Created attachment 198953 [details] [diff] [review]
canvas-image-offset-fix.patch

Fallout from upgrading the version of cairo; handling of the CTM and surface
sources changed.  This should fix it; patch is for trunk and for branch.
Comment 10 Vladimir Vukicevic [:vlad] [:vladv] 2005-10-10 14:29:07 PDT
Comment on attachment 198953 [details] [diff] [review]
canvas-image-offset-fix.patch

Requesting 1.8rc1 approval; canvas bug fix, fixes drawing of images with the
recent cairo 1.0 update.  Low risk and straightforward patch; anything that it
might break is canvas-related.
Comment 11 Jayant Sai 2005-10-26 11:40:43 PDT
This issue is also seen in Firefox 1.5 beta 2. Will it be fixed in the next milestone release of Firefox 1.5?

Note You need to log in before you can comment on or make changes to this bug.