ScrollViewer / TextBlock bug?
I'm prototyping a general dialog with the following XAML:
And style:
In Kaxaml this displays correctly. But in Unity, the contents of the TextBlock that overflows the height of the ScrollViewer isn't hidden, it's displayed outside the ScrollViewer.
Code: Select all
<!-- Dialog -->
<Border Name="dialogBrdr" Style="{StaticResource DialogBorder}">
<StackPanel Name="dialogPnl" Style="{StaticResource DialogPanel}">
<Label Name="dialogLbl" Style="{StaticResource DialogLabel}">Dialog title</Label>
<Rectangle Style="{StaticResource DialogRectangle}" />
<ScrollViewer Name="dialogScrlViwr" Style="{StaticResource DialogScrollViewer}">
<TextBlock Name="dialogCnt" Style="{StaticResource DialogContent}">TextTextTextTextTe xtTextTextTextTextTextTextT extTextTextTextTextText TextTextTextTextTextTextText TextTextTextTextTextTex tTextTextTextText TextTextTextTextTe xtTextTextTextTextTextTextT extTextTextTextTextText TextTextTextTextTextTextText TextTextTextTextTextTex tTextTextTextText TextTextTextTextTe xtTextTextTextTextTextTextT extTextTextTextTextText TextTextTextTextTextTextText TextTextTextTextTextTex tTextTextTextText TextTextTextTextTe xtTextTextTextTextTextTextT extTextTextTextTextText TextTextTextTextTextTextText TextTextTextTextTextTex tTextTextTextText TextTextTextTextTe xtTextTextTextTextTextTextT extTextTextTextTextText TextTextTextTextTextTextText TextTextTextTextTextTex tTextTextTextText</TextBlock>
</ScrollViewer>
<Rectangle Style="{StaticResource DialogRectangle}" />
<StackPanel Orientation="Horizontal">
<Button Name="dialogBtnOk" Style="{StaticResource DialogButtonOk}">Ok</Button>
<Button Name="dialogBtnCancel" Style="{StaticResource DialogButtonCancel}">Cancel</Button>
</StackPanel>
</StackPanel>
</Border>
Code: Select all
<!-- Dialog -->
<Style x:Key="DialogBorder" TargetType="{x:Type Border}">
<Setter Property="BorderBrush" Value="#60000000" />
<Setter Property="CornerRadius" Value="5" />
<Setter Property="BorderThickness" Value="10" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="DialogPanel" TargetType="{x:Type StackPanel}">
<Setter Property="Background" Value="#80000000" />
</Style>
<Style x:Key="DialogLabel" TargetType="{x:Type Label}">
<Setter Property="FontSize" Value="20" />
<Setter Property="Foreground" Value="White" />
<Setter Property="Padding" Value="10" />
</Style>
<Style x:Key="DialogScrollViewer" TargetType="{x:Type ScrollViewer}">
<Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="Margin" Value="10" />
<Setter Property="Background" Value="Green" />
<Setter Property="Height" Value="100" />
</Style>
<Style x:Key="DialogContent" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="14" />
<Setter Property="Foreground" Value="White" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Width" Value="600" />
</Style>
<Style x:Key="DialogButtonOk" TargetType="{x:Type Button}">
<Setter Property="Padding" Value="10" />
<Setter Property="Margin" Value="10" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Foreground" Value="White" />
</Style>
<Style x:Key="DialogButtonCancel" TargetType="{x:Type Button}">
<Setter Property="Padding" Value="10" />
<Setter Property="Margin" Value="0 10" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Foreground" Value="White" />
</Style>
<Style x:Key="DialogRectangle" TargetType="{x:Type Rectangle}">
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Height" Value="2" />
<Setter Property="Fill" Value="#40FFFFFF" />
<Setter Property="Margin" Value="10 0" />
</Style>
-
-
sfernandez
Site Admin
- Posts: 2908
- Joined:
Re: ScrollViewer / TextBlock bug?
Which version of NoesisGUI are you using?
With the release of 1.0.2, we fixed some stencil/clip issues.
Please check with that last version and let me know if your problems is still there, because I was not able to reproduce it with that version.
With the release of 1.0.2, we fixed some stencil/clip issues.
Please check with that last version and let me know if your problems is still there, because I was not able to reproduce it with that version.
Re: ScrollViewer / TextBlock bug?
I'm running on a 1.0.2 preview I got from Jesus. Asset Store in Unity says latest is 1.0.1? Is 1.0.2 final? How do I get it to update in the Asset Store?
-
-
sfernandez
Site Admin
- Posts: 2908
- Joined:
Re: ScrollViewer / TextBlock bug?
You have permissions to download from our forum any updates for Unity package.
Re: ScrollViewer / TextBlock bug?
I downloaded the latest release, deleted all the old files and imported.
Still, I get same error. Also, I get GUI fine in game view, but with newest release when I build & run, I get no GUI and FPS is veeeery low, but works fine in game view aside from the scrollviewer bug.
Still, I get same error. Also, I get GUI fine in game view, but with newest release when I build & run, I get no GUI and FPS is veeeery low, but works fine in game view aside from the scrollviewer bug.
-
-
sfernandez
Site Admin
- Posts: 2908
- Joined:
Re: ScrollViewer / TextBlock bug?
I've just tested in Unity 4.1.4f1 and 4.2.0f4 creating a new Unity project and importing our package. Then I created the following xaml in the assets folder:
I selected the Main camera Gameobject, added a NoesisGUIPanel component, dragged that xaml to the Xaml property. After I hit play the result is:
Could you please follow these steps with a new empty project?
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid.Resources>
<Style x:Key="DialogBorder" TargetType="{x:Type Border}">
<Setter Property="BorderBrush" Value="#60000000" />
<Setter Property="CornerRadius" Value="5" />
<Setter Property="BorderThickness" Value="10" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="DialogPanel" TargetType="{x:Type StackPanel}">
<Setter Property="Background" Value="#80000000" />
</Style>
<Style x:Key="DialogLabel" TargetType="{x:Type Label}">
<Setter Property="FontSize" Value="20" />
<Setter Property="Foreground" Value="White" />
<Setter Property="Padding" Value="10" />
</Style>
<Style x:Key="DialogScrollViewer" TargetType="{x:Type ScrollViewer}">
<Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="Margin" Value="10" />
<Setter Property="Background" Value="Green" />
<Setter Property="Height" Value="100" />
</Style>
<Style x:Key="DialogContent" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="14" />
<Setter Property="Foreground" Value="White" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Width" Value="600" />
</Style>
<Style x:Key="DialogButtonOk" TargetType="{x:Type Button}">
<Setter Property="Padding" Value="10" />
<Setter Property="Margin" Value="10" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Foreground" Value="White" />
</Style>
<Style x:Key="DialogButtonCancel" TargetType="{x:Type Button}">
<Setter Property="Padding" Value="10" />
<Setter Property="Margin" Value="0 10" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Foreground" Value="White" />
</Style>
<Style x:Key="DialogRectangle" TargetType="{x:Type Rectangle}">
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Height" Value="2" />
<Setter Property="Fill" Value="#40FFFFFF" />
<Setter Property="Margin" Value="10 0" />
</Style>
</Grid.Resources>
<Border Name="dialogBrdr" Style="{StaticResource DialogBorder}">
<StackPanel Name="dialogPnl" Style="{StaticResource DialogPanel}">
<Label Name="dialogLbl" Style="{StaticResource DialogLabel}">Dialog title</Label>
<Rectangle Style="{StaticResource DialogRectangle}" />
<ScrollViewer Name="dialogScrlViwr" Style="{StaticResource DialogScrollViewer}">
<TextBlock Name="dialogCnt" Style="{StaticResource DialogContent}">TextTextTextTextTe xtTextTextTextTextTextTextT extTextTextTextTextText TextTextTextTextTextTextText TextTextTextTextTextTex tTextTextTextText TextTextTextTextTe xtTextTextTextTextTextTextT extTextTextTextTextText TextTextTextTextTextTextText TextTextTextTextTextTex tTextTextTextText TextTextTextTextTe xtTextTextTextTextTextTextT extTextTextTextTextText TextTextTextTextTextTextText TextTextTextTextTextTex tTextTextTextText TextTextTextTextTe xtTextTextTextTextTextTextT extTextTextTextTextText TextTextTextTextTextTextText TextTextTextTextTextTex tTextTextTextText TextTextTextTextTe xtTextTextTextTextTextTextT extTextTextTextTextText TextTextTextTextTextTextText TextTextTextTextTextTex tTextTextTextText</TextBlock>
</ScrollViewer>
<Rectangle Style="{StaticResource DialogRectangle}" />
<StackPanel Orientation="Horizontal">
<Button Name="dialogBtnOk" Style="{StaticResource DialogButtonOk}">Ok</Button>
<Button Name="dialogBtnCancel" Style="{StaticResource DialogButtonCancel}">Cancel</Button>
</StackPanel>
</StackPanel>
</Border>
</Grid>

Could you please follow these steps with a new empty project?
Re: ScrollViewer / TextBlock bug?
I have no idea why, but I've narrowed it down to having this ABOVE the dialog xaml code in the grid is causing it...
Can you add that and see if you can reproduce it?
Code: Select all
<WrapPanel>
<TextBlock FontSize="20" Width="40">Test:</TextBlock>
</WrapPanel>
-
-
sfernandez
Site Admin
- Posts: 2908
- Joined:
Re: ScrollViewer / TextBlock bug?
I managed to reduce the XAML to a small sample that reproduces your error:
With this XAML we will be able to track down the problem. It is added to our bug database and will be solved as soon as possible. Thanks for exposing it
Meanwhile, I found that changing the WrapPanel for a Grid makes the ScrollViewer to clip its content correctly. Maybe this could be a workaround for your designs while we solve this bug.
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<WrapPanel>
<TextBlock FontSize="20" Width="40">Test:</TextBlock>
</WrapPanel>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Height="100" Width="400">
<TextBlock FontSize="14" Foreground="White" TextWrapping="Wrap" Width="600">
TextTextTextTextTe xtTextTextTextTextTextTextT extTextTextTextTextText TextTextTextTextTextTextText TextTextTextTextTextTex tTextTextTextText TextTextTextTextTe xtTextTextTextTextTextTextT extTextTextTextTextText TextTextTextTextTextTextText TextTextTextTextTextTex tTextTextTextText TextTextTextTextTe xtTextTextTextTextTextTextT extTextTextTextTextText TextTextTextTextTextTextText TextTextTextTextTextTex tTextTextTextText TextTextTextTextTe xtTextTextTextTextTextTextT extTextTextTextTextText TextTextTextTextTextTextText TextTextTextTextTextTex tTextTextTextText TextTextTextTextTe xtTextTextTextTextTextTextT extTextTextTextTextText TextTextTextTextTextTextText TextTextTextTextTextTex tTextTextTextText
</TextBlock>
</ScrollViewer>
</Grid>

Meanwhile, I found that changing the WrapPanel for a Grid makes the ScrollViewer to clip its content correctly. Maybe this could be a workaround for your designs while we solve this bug.
Who is online
Users browsing this forum: Bing [Bot] and 5 guests