I can’t view the image.

What is ValidateRadioButtonBox based on?  Also what layout is it using?

Royale defaults to not measuring stuff.  Even MXRoyale tries to skip measuring 
stuff.  Measuring stuff is expensive and in the browser, often wrong.  You may 
need to emulate measuredHeight for mx:RadioButton to make your code happy.

If ValidateRadioButtonBox doesn’t have custom layout logic, try creating a test 
case with its base class instead.  And if that fails and you can’t figure out 
why, post that example.

HTH,
-Alex

From: Yishay Weiss <[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Thursday, March 26, 2020 at 11:27 AM
To: "[email protected]" <[email protected]>
Subject: RE: Numbers not initialized to NaN

My problem is that this code

                                                                                
                <inp:ValidatedRadioButtonBox x="169" y="117" 
id="viRadioButtonBox" direction="horizontal" defaultValue="Radio 2">
                                                              <mx:RadioButton 
label="1" value="Radio 1"/>
                                                              <mx:RadioButton 
label="2" value="Radio 2" />
                                                              <mx:RadioButton 
label="3" value="Radio 3"/>
                                                                                
                </inp:ValidatedRadioButtonBox>

Looks like this

[cid:[email protected]]

It’s because the measured height for buttons 1 and 2 is different from button 
3. Moreover, button 3 changes its measured height in different phases of the 
layout due to its positioner.offsetHeight changing.

The weird thing is that positioner looks exactly the same [1], whether its 
offsetHeight is 19 or 34. Any ideas would be welcome.

[1]
<label class="RadioButton" style="position: absolute;"><input type="radio" 
class="RadioButtonIcon" id="_radio_2" value="Radio 3">3</label>

From: Yishay Weiss<mailto:[email protected]>
Sent: Thursday, March 26, 2020 7:50 PM
To: [email protected]<mailto:[email protected]>
Subject: RE: Numbers not initialized to NaN

Investigating. Unrelated to my subject line.

________________________________
From: Alex Harui <[email protected]>
Sent: Thursday, March 26, 2020 7:49:42 PM
To: [email protected] <[email protected]>
Subject: Re: Numbers not initialized to NaN

If I understood that correctly, that's what I would expect, so I don't know why 
it would matter if the value was undefined or initialized to NaN.  And thus, 
I'm not sure why the code went in the wrong direction.

On 3/26/20, 9:45 AM, "Yishay Weiss" <[email protected]> wrote:

    isNaN(undefined) is actually true, same as isNaN(NaN).

    From: Yishay Weiss<mailto:[email protected]>
    Sent: Thursday, March 26, 2020 6:27 PM
    To: [email protected]<mailto:[email protected]>
    Subject: RE: Numbers not initialized to NaN

    Ok, I’ll investigate why it’s undefined.

    > isNaN(percentHeight) is thus evaluated

    I meant !isNaN

    Thanks.


    From: Josh Tynjala<mailto:[email protected]>
    Sent: Thursday, March 26, 2020 6:23 PM
    To: Apache Royale Development<mailto:[email protected]>
    Subject: Re: Numbers not initialized to NaN

    Numbers should be initialized to NaN, unless you've added
    -js-default-initializers=false to your compiler options.

    --
    Josh Tynjala
    Bowler Hat LLC 
<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbowlerhat.dev&amp;data=02%7C01%7Caharui%40adobe.com%7C6705428a9191455871d808d7d1a50d9b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637208379135450031&amp;sdata=xcmYsmsK2XvjI8R2c8lZn36u5Y4ksvUci7392Co1IqU%3D&amp;reserved=0<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbowlerhat.dev&data=02%7C01%7Caharui%40adobe.com%7C18634ac5927647aae7d308d7d1b35ebf%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637208440634779486&sdata=%2FXhcapdiyiEPe4nLBJCrlbYRCWTzcYrBj%2FWaLJt6pVE%3D&reserved=0>>


    On Thu, Mar 26, 2020 at 9:17 AM Yishay Weiss <[email protected]> wrote:

    > I think this might have come up in one of my previous posts so my
    > apologies if I’m repeating a question. In Flex.as we have the following
    > code:
    >
    >                                                 if (!isNaN(percentHeight)
    > && child.includeInLayout)
    >                                                 {
    >                                                                 height =
    > Math.max(child.minHeight,
    >
    >       Math.min(child.maxHeight,
    >
    >       ((percentHeight >= 100) ? h : h * percentHeight / 100)));
    >                                                 }
    >
    > percentHeight, which is a Number, seems to be initialized to undefined.
    > isNaN(percentHeight) is thus evaluated to true which results in the wrong
    > height being set.
    >
    > Should I change the code to check for undefined instead of NaN, or should
    > the compiler initialized to NaN?
    >




Reply via email to