lboldt
Topic Author
Posts: 14
Joined: 13 Aug 2013, 04:03

ScrollViewer / TextBlock bug?

19 Aug 2013, 01:21

I'm prototyping a general dialog with the following XAML:
<!-- 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>
And style:
<!-- 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>
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.
 
User avatar
sfernandez
Site Admin
Posts: 2908
Joined: 22 Dec 2011, 19:20

Re: ScrollViewer / TextBlock bug?

19 Aug 2013, 12:16

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.
 
lboldt
Topic Author
Posts: 14
Joined: 13 Aug 2013, 04:03

Re: ScrollViewer / TextBlock bug?

19 Aug 2013, 15:45

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?
 
User avatar
sfernandez
Site Admin
Posts: 2908
Joined: 22 Dec 2011, 19:20

Re: ScrollViewer / TextBlock bug?

19 Aug 2013, 16:02

You have permissions to download from our forum any updates for Unity package.
 
lboldt
Topic Author
Posts: 14
Joined: 13 Aug 2013, 04:03

Re: ScrollViewer / TextBlock bug?

19 Aug 2013, 16:45

I downloaded the latest release, deleted all the old files and imported.

Still, I get same error.
scrollviewer.jpg
scrollviewer.jpg (102.32 KiB) Viewed 3712 times
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.
 
User avatar
sfernandez
Site Admin
Posts: 2908
Joined: 22 Dec 2011, 19:20

Re: ScrollViewer / TextBlock bug?

19 Aug 2013, 17:35

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:
<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>
I selected the Main camera Gameobject, added a NoesisGUIPanel component, dragged that xaml to the Xaml property. After I hit play the result is:
scrollviewer.png
scrollviewer.png (21.78 KiB) Viewed 3706 times
:?

Could you please follow these steps with a new empty project?
 
lboldt
Topic Author
Posts: 14
Joined: 13 Aug 2013, 04:03

Re: ScrollViewer / TextBlock bug?

19 Aug 2013, 20:02

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...
<WrapPanel>
    <TextBlock FontSize="20" Width="40">Test:</TextBlock>  
</WrapPanel>
Can you add that and see if you can reproduce it?
 
User avatar
sfernandez
Site Admin
Posts: 2908
Joined: 22 Dec 2011, 19:20

Re: ScrollViewer / TextBlock bug?

19 Aug 2013, 22:06

I managed to reduce the XAML to a small sample that reproduces your error:
<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>
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.

Who is online

Users browsing this forum: Bing [Bot] and 5 guests