[fixed] Incorrect rendering of borders with CornerRadius=0 and BorderThickness>0 (1 Viewer)

morpheus_xx

Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,070
    7,459
    Home Country
    Germany Germany
    I was trying to draw a glassy overlay for images using Microsoft Expression Blend.

    The XAML is valid for MPF use, but the rendering of outputs is wrong:

    There is a issue in the screenshots:
    When there is a BorderThickness > 0, the edges are "cut off" wrongly.

    XAML code of the borders (1) and the Canvas using the LinearGradientBrush (2)
    Code:
                <Border Grid.Column="0" Grid.Row="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" x:Name="Layer_14" Margin="0" BorderBrush="Black"
                        CornerRadius="0" BorderThickness="2"/>
                <Border Grid.Column="0" Grid.Row="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" x:Name="Layer_5" Margin="2" BorderBrush="#4A808080"
                        CornerRadius="0" BorderThickness="8"/>
                <Border Grid.Column="0" Grid.Row="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" x:Name="Layer_1" Margin="11" Opacity="1" BorderBrush="Black"
                        CornerRadius="0" BorderThickness="3"/>
                <Border Grid.Column="0" Grid.Row="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" x:Name="Layer_12" Margin="13" Opacity="0.49" BorderBrush="White"
                        CornerRadius="0" BorderThickness="3"/>
                <Border Grid.Column="0" Grid.Row="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" x:Name="Layer_14-1" Margin="16" Opacity="1" BorderBrush="Black"
                        CornerRadius="0" BorderThickness="15"/>
    
                <Control Grid.Column="0" Grid.Row="0" x:Name="ControlPresenter" Margin="31" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                    Template="{DynamicResource ResourceKey=MakeGlass}" />
    
                <Canvas Grid.Column="0" Grid.Row="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                  <Canvas.Background>
                    <LinearGradientBrush StartPoint="1,0" EndPoint="0.65,0.65">
                      <GradientStop Offset="0" Color="#4AFFFFFF"/>
                      <GradientStop Offset="0.961" Color="#40FFFFFF"/>
                      <GradientStop Offset="1" Color="#00FFFFFF"/>
                    </LinearGradientBrush >
                  </Canvas.Background>
                </Canvas>
     

    Attachments

    • Blend_Original.png
      Blend_Original.png
      116.1 KB
    • MPF_Not_Working.png
      MPF_Not_Working.png
      135 KB

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    47
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    AW: Incorrect rendering of borders with CornerRadius=0 and BorderThickness>0

    The borders are drawn correctly; it's the only supported mode for strokes currently. I was about to add more of the modes supported by WPF but I didn't implement it yet; it's much work.

    Can you give me more problem about the problem with the reflections?
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,070
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #3
    AW: Incorrect rendering of borders with CornerRadius=0 and BorderThickness>0

    I started to create a patch to add PenLineJoin support to MPF:

    Shape.StrokeLineJoin: StrokeLineJoin Property
    PenLineJoin enum: PenLineJoin Enumeration

    I extended MPF's:
    - Shape class to support StrokeLineJoin property (WPF conform)
    - Border class to support BorderLineJoin property (not defined in WPF)

    See both images (before + after)
     

    Attachments

    • MPF_Not_Working.png
      MPF_Not_Working.png
      135 KB
    • MPF_BorderLineJoin.png
      MPF_BorderLineJoin.png
      117.7 KB
    • 0001-Added-support-for-different-PenLineJoins-for-Shapes-.patch
      21.1 KB

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,070
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #5
    AW: Incorrect rendering of borders with CornerRadius=0 and BorderThickness>0

    I've set this to fixed: a newer implementation of Miter has been done and commited.
     

    Users who are viewing this thread

    Top Bottom