PDA

View Full Version : [CLOSED]Rounding error in getViewSize



arnaldur
8 Mar 2010, 3:27 AM
Hi

I'm having problems with the anchor layout, I'm using a form inside a html container that is rendered using the anchor layout, when the window is not in fullscreen fields get rendered using wrong width.

I traced the problem down to a regexp that looks like this, on line 4311 in ext-all-debug.js 3.1.0:

w = me.getStyle('width').match(pxMatch)

When using this expression against some width like:
input: "234.7px".match(pxMatch)
output: 7px

input: "234.5px".match(pxMatch)
output: 5px

the width of the container is decided using percentage width, and I'm not using extjs container around all elements on the page.

The question is if there is a workaround or is this something that extjs would want to handle?

Regards
Arnaldur

arnaldur
8 Mar 2010, 3:31 AM
It's probably relevant to mention that this is a firefox 3.5-3.6 only error, no other browsers are affected.

arnaldur
8 Mar 2010, 3:58 AM
Quick fix, change the regexp pxMatch

from:
/(\d+)px/


to:
/(\d+).*px/

evant
8 Mar 2010, 3:59 AM
This issue is already resolved and is part of 3.1.1.