Closed Bug 298098 Opened 19 years ago Closed 19 years ago

currentScale and currentTranslate should be in viewPort coordinates

Categories

(Core :: SVG, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: holger, Assigned: jwatt)

Details

Attachments

(4 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050616 Firefox/1.0+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050616 Firefox/1.0+ when setting currentScale, the effect differs to the behaviour of ASV and Batik, in the testcase, setting currentScale=0.5 causes the graphic to be offset by exacly a forth of the viewBox's width . Reproducible: Always Steps to Reproduce: 1.open the testcase 2.compare output to ASV and Batik 3. Actual Results: the red rect becomes visible Expected Results: the red rect should be outside of the viewport this is important to make getScreenCTM() behave correctly when the document is zoomed and paned, see https://bugzilla.mozilla.org/show_bug.cgi?id=293224 getScreenCTM() again is important to get my Zoom and Pan controlls to work. probably also effecting https://bugzilla.mozilla.org/show_bug.cgi?id=163068
Attached image testcase
ok, i got getScreenCTM working correctly now, and my Zoom and Pan controlls, too. for me it seems, that the discribed behavior is not a bug, but in fact ASV6 and Batik are doing it wrong... i try to find clearification . in the meantime please ignore this bug.
so it seems, this is indeed a bug in mozilla, the spec says that: If "magnification" is enabled (i.e., zoomAndPan="magnify"), then the effect is as if an extra transformation were placed at the outermost level on the SVG document fragment (i.e., outside the outermost 'svg' element). so currentTransform and currentScale should be in viewPort coordinates, not in viewBox coordinates.
this should result in a 500x500 svg image, where 1/10th is white, and the rest is black, actual result half of the image is white.
half of this image should be white, the other half black. actual result, the black rect is outside of the viewPort, the whole image is white.
Summary: currentScale not implemented correctly → currentScale and currentTranslate should be in viewPort coordinates
could someone please confirm this bug ? this is a very important issue! if not fixed before FF1.1 , it will break any!! script that needs document or element coordinates (drawing , dragndrop, page navigation, gui elements , tooltips , fixed positioned Elements, nonscaling stroke/symbols ...). additionaly people will write scripts that only run in moz, increasing the number of broken SVG files on the net, so please, could someone take care about this Bug ? Jonathan ? tor ?
Oops, yeah, you're right. Thanks for catching this Holger. The fix should be trivial.
Severity: normal → major
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Attached patch patchSplinter Review
Something like this should do the trick.
Assignee: general → jonathan.watt
Status: NEW → ASSIGNED
Attachment #187312 - Flags: review?(tor)
i guessed it would be something simple, thank for taking care, jonathan !
Attachment #187312 - Flags: review?(tor) → review+
Attachment #187312 - Flags: approval1.8b3?
Comment on attachment 187312 [details] [diff] [review] patch a=chofmann
Attachment #187312 - Flags: approval1.8b3? → approval1.8b3+
Marking FIXED. Checking in mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp; /cvsroot/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp,v <-- nsSVGOuterSVGFrame.cpp new revision: 1.44; previous revision: 1.43 done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
confirming fix, thanks !
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: