<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="0.91">
    <channel>
        <title>How to get absolute X/Y coordinates of an item</title>
        <description>The 10 most recently added comments in the topic &quot;How to get absolute X/Y coordinates of an item&quot;</description>
        <link>http://www.freewaytalk.net/</link>
        <lastBuildDate>Wed, 19 Nov 2008 10:11:10 -500</lastBuildDate>
        <generator>FeedCreator 1.7.2</generator>
        <item>
            <title>Re: How to get absolute X/Y coordinates of an item</title>
            <link>http://www.freewaytalk.net/thread/view/35240#m_35559</link>
            <description>&lt;p&gt;So could the &amp;#8220;real&amp;#8221; top/left please stand up in Freeway 5? As Joe
pointed out, it is known to Freeway up until the moment the mouse
cursor is released on a draw. Does anyone else need this, or am I
alone in wanting to &amp;#8220;absolutize&amp;#8221; elements at whim inside an Action?&lt;/p&gt;

&lt;p&gt;Walter&lt;/p&gt;

&lt;p&gt;On Jun 30, 2008, at 10:37 AM, alan wrote:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Hi,&lt;/p&gt;
  
  &lt;p&gt;The top/left was introduced in Freeway 3 (as I remember) and when
  we moved to nested items it returns the relative co-ordinates.&lt;/p&gt;
  
  &lt;p&gt;Alan&lt;/p&gt;
  
  &lt;hr /&gt;
  
  &lt;p&gt;actionsdev mailing list
  email@hidden
  Update your subscriptions at:
  &lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;p&gt;actionsdev mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>waltd</author>
            <pubDate>Mon, 30 Jun 2008 14:47:32 -500</pubDate>
        </item>
        <item>
            <title>Re: How to get absolute X/Y coordinates of an item</title>
            <link>http://www.freewaytalk.net/thread/view/35240#m_35558</link>
            <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;The top/left was introduced in Freeway 3 (as I remember) and when we moved to nested items it returns the relative co-ordinates.&lt;/p&gt;

&lt;p&gt;Alan&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;actionsdev mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>alan</author>
            <pubDate>Mon, 30 Jun 2008 14:37:26 -500</pubDate>
        </item>
        <item>
            <title>Re: How to get absolute X/Y coordinates of an item</title>
            <link>http://www.freewaytalk.net/thread/view/35240#m_35286</link>
            <description>&lt;p&gt;Since the inspector doesn&amp;#8217;t even show you the absolute location of the item, I wonder if it&amp;#8217;s even &amp;#8220;recorded&amp;#8221; anywhere in Freeway. To my mind, the absolute coordinates should be in the &amp;#8220;Screen Measurements&amp;#8221; area, and the relative positioning under &amp;#8220;Dimensions&amp;#8221; if it&amp;#8217;s a child item.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s something related that&amp;#8217;s strange. I drew an HTML item on the page, then drew a child HTML item inside it. While I was drawing the child item, the X and Y coords were the absolute value on the page. As soon as I was finished drawing, both sets of X/Y coords popped to show the relative location.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;actionsdev mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>Joe Muscara</author>
            <pubDate>Tue, 24 Jun 2008 20:36:03 -500</pubDate>
        </item>
        <item>
            <title>Re: How to get absolute X/Y coordinates of an item</title>
            <link>http://www.freewaytalk.net/thread/view/35240#m_35272</link>
            <description>&lt;p&gt;Answering my own question&amp;#8230;&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s a partial solution. I haven&amp;#8217;t tested to see what it does on a non-layer item, it might work.&lt;/p&gt;

&lt;p&gt;This is a recursive function that creates a pair of dummy variables on the item, and then walks up the tree to find the cumulative offset from 0,0. The return value is an array of (top,left) as integers.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function getPosition(item){
    if(!item['_top']) item['_top'] = item.fwTop;
    if(!item['_left']) item['_left'] = item.fwLeft;
    if(item.fwParent){
        var p = item.fwParent;
        if(p.toString().indexOf(&quot;PageDiv&quot;) &amp;lt; 0){
            p['_top'] = item._top + p.fwTop;
            p['_left'] = item._left + p.fwLeft;
            return getPosition(p);
        }
    }
    return [item._top,item._left];
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This feels sort of hacky to me, it would be nice if Freeway would just tell us this directly without so much introspection. I stand ready to be told that there&amp;#8217;s an undocumented property like fwItem.fwAbsTop hiding in there somewhere&amp;#8230;&lt;/p&gt;

&lt;p&gt;Walter&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;actionsdev mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>waltd</author>
            <pubDate>Tue, 24 Jun 2008 17:13:40 -500</pubDate>
        </item>
        <item>
            <title>How to get absolute X/Y coordinates of an item</title>
            <link>http://www.freewaytalk.net/thread/view/35240</link>
            <description>&lt;p&gt;It&amp;#8217;s easy to parse the style tag of an item and read its top and left
properties if it&amp;#8217;s a layer. But this method falls down if the item in
question is grouped or otherwise nested within another object, or if
it is not a layer.&lt;/p&gt;

&lt;p&gt;Is there any way to get the geometry of a fwItem with respect to the
page itself, ignoring any parents?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Walter&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;actionsdev mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>waltd</author>
            <pubDate>Tue, 24 Jun 2008 03:27:43 -500</pubDate>
        </item>
    </channel>
</rss>
