Closed
Bug 261800
Opened 21 years ago
Closed 21 years ago
svg getBBox implementation
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
People
(Reporter: tor, Unassigned)
References
Details
Attachments
(1 file, 2 obsolete files)
47.53 KB,
patch
|
scootermorris
:
review+
|
Details | Diff | Splinter Review |
Does anyone have an idea for a more elegant way of implementing
getBBox? It's needed for filters, which by default are bounded
in object space coordinates.
Attachment #160235 -
Attachment is obsolete: true
Attachment #167586 -
Flags: review?(scootermorris)
Attachment #167586 -
Flags: review?(scootermorris)
Attachment #167586 -
Attachment is obsolete: true
Attachment #168057 -
Flags: review?(scootermorris)
![]() |
||
Comment 5•21 years ago
|
||
Comment on attachment 168057 [details] [diff] [review]
slightly cleaner version
Tim,
scooter review+ provided that the two fprintf's to stderr get removed.
>+NS_IMETHODIMP
>+nsSVGGFrame::GetBBox(nsIDOMSVGRect **_retval)
>+{
......
This shouldn't be here anymore....
>+ fprintf(stderr, "subframe %f %f %f %f\n", bminx, bminy, bmaxx, bmaxy);
>+
>
>+void
>+nsSVGGlyphFrame::TransformPoint(float& x, float& y)
>+{
>+ nsCOMPtr<nsIDOMSVGMatrix> ctm;
>+ GetCanvasTM(getter_AddRefs(ctm));
>+ if (!ctm)
>+ return;
Any reason not to do this?
>+
>+ // XXX this is absurd! we need to add another method (interface
>+ // even?) to nsIDOMSVGMatrix to make this easier. (something like
>+ // nsIDOMSVGMatrix::TransformPoint(float*x,float*y))
>+
>+ nsCOMPtr<nsIDOMSVGPoint> point;
>+ NS_NewSVGPoint(getter_AddRefs(point), x, y);
>+ if (!point)
>+ return;
>+
>+NS_IMETHODIMP
> nsSVGInnerSVGFrame::GetBBox(nsIDOMSVGRect **_retval)
> {
...
This needs to get deleted also...
>+
>+ fprintf(stderr, "subframe %f %f %f %f\n", bminx, bminy, bmaxx, bmaxy);
>+
>+ if (!unionRect)
>+ unionRect = box;
>+ minx = PR_MIN(minx, bminx);
>+ miny = PR_MIN(miny, bminy);
>+ maxx = PR_MAX(maxx, bmaxx);
>+ maxy = PR_MAX(maxy, bmaxy);
>+ }
>+ }
Attachment #168057 -
Flags: review?(scootermorris) → review+
> Any reason not to do this?
> >+ // XXX this is absurd! we need to add another method (interface
> >+ // even?) to nsIDOMSVGMatrix to make this easier. (something like
> >+ // nsIDOMSVGMatrix::TransformPoint(float*x,float*y))
This is a comment copied from nsSVGForeignObjectFrame - that method used
to be a lot uglier when we needed to search for the outer svg frame.
There's also that lingering question of if we should be adding
implementation helpers to the DOM.
Checked in - thanks.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•