Hi Philippe,

Another alternative which fixes the root cause of the issue, is to call -

canvas.getCanvasElement().getStyle().setDisplay(Display.BLOCK);

The problem is that the canvas display mode is inline, which causes
strange alignment issues like these (strange that is, unless you want
it to behave as inline element). You can see this in action by adding
a display:block to the canvas element using your browser's dev tools
at http://gwtcanvasdemo.appspot.com/.

Chris

On Tue, Feb 7, 2012 at 4:10 PM, Philippe Lhoste <[email protected]> wrote:
> On 07/02/2012 15:20, Rob wrote:
>>>
>>> s.setProperty("lineHeight", 10, Style.Unit.PX);
>>
>>
>> That works for me too.  Thank you for taking the time to look at it.
>
>
> It is always an opportunity to learn new things... :-)
>
>
>> After sleeping I see that I was forgetting the<!doctype html>  at the
>> top of my static files, which caused them to render differently,
>> without the space.  So it's not a GWT issue.  And after seeing your
>> line-height suggestion, I thought of vertical-align.  Setting vertical-
>> align:bottom (vs default of 'baseline') on the canvas eliminates the
>> extra space, as desired.
>
>
> Aah, smart, cleaner than setting line-height to an arbitrary value, indeed.
> Good to know. Thanks.
>
>
> --
> Philippe Lhoste
> --  (near) Paris -- France
> --  http://Phi.Lho.free.fr
> --  --  --  --  --  --  --  --  --  --  --  --  --  --
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to