Sybaris
Topic Author
Posts: 23
Joined: 21 Feb 2019, 10:13

Noesis GUI crashes Unity in ArrangeOverride/MeasureBaseCallback

27 Apr 2021, 12:38

Hi,

Noesis GUI silently crashes Unity when calling "measureBaseCallback" in ArrangeOverride - at least that's the last point where I can trace it before it crashes.
        protected virtual Size ArrangeOverride(Size finalSize)
        {
            Size renderSize = new Size(0.0f, 0.0f);
            if (_measureBaseCallback != null)
            {
                _measureBaseCallback(swigCPtr, ref finalSize, ref renderSize);
            }
            return renderSize;
        }
I'm pretty sure that the cause for this is on my side, but nevertheless it shouldn't crash Unity I believe. This way it's pretty difficult to find out what the problem is.
I can upload the solution if necessary.

Sorry, I forgot: I'm using Noesis 3.

Tags:
 
Sybaris
Topic Author
Posts: 23
Joined: 21 Feb 2019, 10:13

Re: Noesis GUI crashes Unity in ArrangeOverride/MeasureBaseCallback

27 Apr 2021, 15:50

I could narrow it down a bit. I'm using a TextBox style + template - as soon as I remove the PART_ContentHost name tag, it doesn't crash anymore; but of course then the TextBox doesn't work anymore either...
    <Style TargetType="{x:Type TextBox}">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Padding" Value="3" />
        <Setter Property="MinHeight" Value="25" />
        <Setter Property="AllowDrop" Value="true" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Margin" Value="3" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Background" Value="#28000000" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBoxBase}">
                    <Border
                            x:Name="Border"
                            Background="{TemplateBinding Background}"
                            BorderBrush="Transparent"
                            BorderThickness="1"
                            SnapsToDevicePixels="True">
                        <ScrollViewer
                                x:Name="PART_ContentHost"
                                Margin="0"
                                VerticalScrollBarVisibility="Hidden" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource BlueAccentBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
 
Sybaris
Topic Author
Posts: 23
Joined: 21 Feb 2019, 10:13

Re: Noesis GUI crashes Unity in ArrangeOverride/MeasureBaseCallback

27 Apr 2021, 18:31

I just found that something similar was already reported as a bug: https://www.noesisengine.com/bugs/print ... b736c5b7a4, reported by "Sergey".

If I replace the ScrollViewer with a border, the exception is gone.

by the way: the xrash only happens when the game is run.
 
Sybaris
Topic Author
Posts: 23
Joined: 21 Feb 2019, 10:13

Re: Noesis GUI crashes Unity in ArrangeOverride/MeasureBaseCallback

27 Apr 2021, 19:32

I think I found the problem. Giving the ScrollViewer a default template - I do not use the themes - eliminates the crash.
Nevertheless: Unity shouldn't crash on this...
 
User avatar
sfernandez
Site Admin
Posts: 2255
Joined: 22 Dec 2011, 19:20

Re: Noesis GUI crashes Unity in ArrangeOverride/MeasureBaseCallback

27 Apr 2021, 21:46

Yes, this is related to the indicated bug report: #1968
We already solved it for the next release.

Who is online

Users browsing this forum: Google [Bot] and 3 guests