W3C home > Mailing lists > Public > www-svg@w3.org > July 2007

Re: Regarding viewport question

From: Erik Dahlström <ed@opera.com>
Date: Wed, 11 Jul 2007 13:54:54 +0200
To: "Mustafizur Rahaman" <mustaf.here@gmail.com>
Cc: www-svg@w3.org
Message-ID: <op.tvat1sf4gqiacl@gnorps.palace.opera.no>

On Wed, 11 Jul 2007 13:13:57 +0200, Mustafizur Rahaman  
<mustaf.here@gmail.com> wrote:

> Thanks a lot Eric.
>
> Please see my response embedded in your email below.
>
> Regs,
>
> On 7/11/07, Erik Dahlström <ed@opera.com> wrote:
>>
>> On Wed, 11 Jul 2007 12:01:15 +0200, Mustafizur Rahaman
>> <mustaf.here@gmail.com> wrote:
>>
>> > Hi All:
>> >
>> > Can any one please respond to me...and if the question is not  
>> clear,let
>> > me
>> > know, i can try to explain where ever any one has problem.
>> >
>> > Thanks.
>> >
>> >
>> > On 7/10/07, Mustafizur Rahaman <mustaf.here@gmail.com> wrote:
>> >>
>> >> Hi All:
>> >>
>> >> I read that as per SVG 1.2 Tiny, only svg,image,video,animation  
>> element
>> >> can have their own viewport.  I saw that in SVG 1.1 there is  
>> something
>> >> symbol element which can have their own viewport, but symbol element  
>> is
>> >> not
>> >> mentioned in SVG Tiny 1.2. So, my question is other than svg,
>> >> image,video,animation, is there any other element in SVG Tiny 1.2  
>> which
>> >> can have their own viewport.
>>
>> I'm not sure if 1.2T is different, but 1.1 mentions the foreignObject
>> element.
>
> Yes, i saw foreign objects were there in SVG 1.1 but it was not  
> mentioned in
> SVG 1.2T.So, my understanding is if one element is mentioned in SVG 1.1 &
> then not mentioned in SVG 1.2T(e.g. symbol element), then it means SVG  
> 1.2T
> *DOES NOT *support that element(symbol element in this case).
>
> Is my understanding correct here?

Yes.

>>> Let me explain the problem, so that you will understand it better.
>> >>
>> >> Let's say i have a triangle which i have constructed using path
>> >> element.This triangle i want to draw at three places on my SVG  
>> canvas,
>> >> but
>> >> each of the triangle should be of different size.I can achieve it  
>> using
>> >> transform attribute, but my problem is i dont know the scale factor  
>> in
>> >> advance.
>>
>> Sounds like you should use the <use> element with different values on  
>> each
>> for the transform attribute.
>> You can change the transform attribute in script if you know later which
>> scale factor to use.
>
> Correct you are, but as i mentioned i dont know the transform factor at  
> all,
> i can't use this mechanism.What i know is only the rectangular region  
> where
> i need to draw the triangle, so i need some sort of viewBox/viewport
> support.

If you know:
a) the boundingbox of the triangle graphic (which can be done by  
yourelement.getBBox() in script)
b) the destination rectangle

Then it shouldn't be impossible to calculate an appropriate scale factor,  
right?

>>> what i want to do is that, on my canvas i can specify three rectangular
>> >> region each of different sizes, and when the triangle will be drawn  
>> in
>> >> that
>> >> rectangular region, the triangle size will be changed automatically
>> >> depending on the rectangular region( let's assume i want to maintain
>> >> aspect
>> >> ratio)
>>
>> Right, so if you want to use preserveAspectRatio with some value then  
>> you
>> need to use <symbol> (which only works if the viewer supports SVG 1.1).
>> Another option is to use <animation> but then you have to put your
>> triangle in a separate file since <animation> can't contain a fragment
>> identifier in the xlink:href.
>> Yet another option is to use an <svg> subfragment in the main svg file,
>> but that's not supported in 1.2T either, and <use> is forbidden to point
>> at an <svg> fragment in 1.2T.
>>
>> The <image> element won't work because you can't reference an svg with  
>> it
>> according to 1.2T.
>
>
> So, as per above, i think using the animation in a different file is the
> only possible solution.Let me try with this to see how it works.

Ok.

Cheers
/Erik

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Received on Wednesday, 11 July 2007 11:55:20 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:37 GMT