Home » Eclipse Projects » Remote Application Platform (RAP) » computeSize returns different values after some point of time
computeSize returns different values after some point of time [message #1046842] |
Mon, 22 April 2013 13:00 |
Mariusz Cwikla Messages: 15 Registered: January 2012 |
Junior Member |
|
|
Hi,
we have encountered a strange flickering effect. It's caused by size calculations. When you first start an application and open a window any widget that has a text gets it's size and quickly repositioned.
computeSize method returns different widget size for the same widget after some point of time.
For example - I have a login dialog with 3 labels. I noticed that problem lies in following piece of code (Label.computeSize):
if( markupEnabled ) {
extent = TextSizeUtil.markupExtent( getFont(), text, wrapWidth );
} else {
extent = TextSizeUtil.textExtent( getFont(), text, wrapWidth );
}
width = extent.x;
After a while "extent = TextSizeUtil.textExtent(....)" returns different results than in the beginning.
Here are values of extent after first, second and third call for three different labels:
Login = {26, 14} {26, 14} {26, 14}
Hasło = {26, 14} {26, 14} {27, 14}
Język = {26, 14} {26, 14} {28, 14}
We have the same problem with other widgets too.
Is it a bug in RAP?
|
|
|
Re: computeSize returns different values after some point of time [message #1046858 is a reply to message #1046842] |
Mon, 22 April 2013 13:19 |
Ivan Furnadjiev Messages: 2427 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Mariusz,
actually this is by design. The TextSizeDetermination (TSD) in RAP is
working that way:
- when you request the size of a text, which is not yet measured on the
client, an estimated size is returned.
- the text is sent to the client for real measurement.
- the real (measured) size is returned back to the server and stored.
- layout is performed in order to properly resize all the widgets with
the correct text size.
Best,
Ivan
On 4/22/2013 4:00 PM, Mariusz Cwikla wrote:
> Hi,
> we have encountered a strange flickering effect. It's caused by size
> calculations. When you first start an application and open a window
> any widget that has a text gets it's size and quickly repositioned.
>
> computeSize method returns different widget size for the same widget
> after some point of time.
>
> For example - I have a login dialog with 3 labels. I noticed that
> problem lies in following piece of code (Label.computeSize):
>
> if( markupEnabled ) {
> extent = TextSizeUtil.markupExtent( getFont(), text, wrapWidth );
> } else {
> extent = TextSizeUtil.textExtent( getFont(), text, wrapWidth );
> }
> width = extent.x;
>
> After a while "extent = TextSizeUtil.textExtent(....)" returns
> different results than in the beginning.
> Here are values of extent after first, second and third call for three
> different labels:
>
> Login = {26, 14} {26, 14} {26, 14}
> Hasło = {26, 14} {26, 14} {27, 14}
> Język = {26, 14} {26, 14} {28, 14}
>
> We have the same problem with other widgets too.
>
> Is it a bug in RAP?
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
| | |
Goto Forum:
Current Time: Tue Sep 24 19:51:26 GMT 2024
Powered by FUDForum. Page generated in 0.03438 seconds
|