Browse Source

Merge branch 'master' into fixes/2284-deffered-renderer-nre

pull/2286/head
danwalmsley 8 years ago
committed by GitHub
parent
commit
59492694f6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      .github/PULL_REQUEST_TEMPLATE.md
  2. 13
      src/Avalonia.Controls/Shapes/Shape.cs

17
.github/PULL_REQUEST_TEMPLATE.md

@ -1,18 +1,18 @@
## What does the pull request do? ## What does the pull request do?
<!--- Give a bit of background on the PR here, together with links to with related issues etc. -->
Give a bit of background on the PR here, together with links to with related issues etc.
## What is the current behavior? ## What is the current behavior?
<!--- If the PR is a fix, describe the current incorrect behavior, otherwise delete this section. -->
If the PR is a fix, describe the current incorrect behavior, otherwise delete this section.
## What is the updated/expected behavior with this PR? ## What is the updated/expected behavior with this PR?
<!--- Describe how to test the PR. -->
Describe how to test the PR.
## How was the solution implemented (if it's not obvious)? ## How was the solution implemented (if it's not obvious)?
<!--- Include any information that might be of use to a reviewer here. -->
Include any information that might be of use to a reviewer here.
## Checklist ## Checklist
@ -21,12 +21,11 @@ Include any information that might be of use to a reviewer here.
- [ ] Consider submitting a PR to https://github.com/AvaloniaUI/Avaloniaui.net with user documentation - [ ] Consider submitting a PR to https://github.com/AvaloniaUI/Avaloniaui.net with user documentation
## Breaking changes ## Breaking changes
<!--- List any breaking changes here. When the PR is merged please add an entry to https://github.com/AvaloniaUI/Avalonia/wiki/Breaking-Changes -->
List any breaking changes here. When the PR is merged please add an entry to https://github.com/AvaloniaUI/Avalonia/wiki/Breaking-Changes
## Fixed issues ## Fixed issues
<!--- If the pull request fixes issue(s) list them like this:
If the pull request fixes issue(s) list them like this:
Fixes #123 Fixes #123
Fixes #456 Fixes #456
-->

13
src/Avalonia.Controls/Shapes/Shape.cs

@ -20,7 +20,10 @@ namespace Avalonia.Controls.Shapes
AvaloniaProperty.Register<Shape, IBrush>(nameof(Stroke)); AvaloniaProperty.Register<Shape, IBrush>(nameof(Stroke));
public static readonly StyledProperty<AvaloniaList<double>> StrokeDashArrayProperty = public static readonly StyledProperty<AvaloniaList<double>> StrokeDashArrayProperty =
AvaloniaProperty.Register<Shape, AvaloniaList<double>>("StrokeDashArray"); AvaloniaProperty.Register<Shape, AvaloniaList<double>>(nameof(StrokeDashArray));
public static readonly StyledProperty<double> StrokeDashOffsetProperty =
AvaloniaProperty.Register<Shape, double>(nameof(StrokeDashOffset));
public static readonly StyledProperty<double> StrokeThicknessProperty = public static readonly StyledProperty<double> StrokeThicknessProperty =
AvaloniaProperty.Register<Shape, double>(nameof(StrokeThickness)); AvaloniaProperty.Register<Shape, double>(nameof(StrokeThickness));
@ -103,6 +106,12 @@ namespace Avalonia.Controls.Shapes
get { return GetValue(StrokeDashArrayProperty); } get { return GetValue(StrokeDashArrayProperty); }
set { SetValue(StrokeDashArrayProperty, value); } set { SetValue(StrokeDashArrayProperty, value); }
} }
public double StrokeDashOffset
{
get { return GetValue(StrokeDashOffsetProperty); }
set { SetValue(StrokeDashOffsetProperty, value); }
}
public double StrokeThickness public double StrokeThickness
{ {
@ -124,7 +133,7 @@ namespace Avalonia.Controls.Shapes
if (geometry != null) if (geometry != null)
{ {
var pen = new Pen(Stroke, StrokeThickness, new DashStyle(StrokeDashArray), var pen = new Pen(Stroke, StrokeThickness, new DashStyle(StrokeDashArray, StrokeDashOffset),
StrokeDashCap, StrokeStartLineCap, StrokeEndLineCap, StrokeJoin); StrokeDashCap, StrokeStartLineCap, StrokeEndLineCap, StrokeJoin);
context.DrawGeometry(Fill, pen, geometry); context.DrawGeometry(Fill, pen, geometry);
} }

Loading…
Cancel
Save