tags:

views:

31

answers:

1

I have a gwt image object . In my code I set my visibleRect like this:

btnSearch.setVisibleRect(-64,-80,16,16);

So when I run my code with firebug the html looks like this:

<img border="0" style="width: 16px; height: 16px; background: url(&quot;http://tempest/deltaflow/Content/Images/icon.png&amp;quot;) no-repeat scroll 64px 80px transparent;" src="http://127.0.0.1:8888/trunkui/clear.cache.gif"&gt;

Why is the '-' left off? When I edit it with firebug to have the '-' it works fine.

+1  A: 

According to [http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/Image.html#setVisibleRect(int, int, int, int)][1] the values inside setvisiblerect can never be negative. measuer ur desired rectangle portion from your top left corner and try again.

[1]: http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/Image.html#setVisibleRect(int, int, int, int)

Kasturi