Using the SkPaint::Style instead of a simple bool

Works around #135
This commit is contained in:
Matthew Leibowitz 2016-08-17 04:29:27 +02:00
Родитель b101a1129a
Коммит cbac9ec7b0
4 изменённых файлов: 21 добавлений и 5 удалений

Просмотреть файл

@ -347,6 +347,13 @@ namespace SkiaSharp
ClampToBlack,
}
public enum SKPaintStyle
{
Fill,
Stroke,
StrokeAndFill,
}
public enum SKRegionOperation
{
Difference,

Просмотреть файл

@ -64,10 +64,19 @@ namespace SkiaSharp
public bool IsStroke {
get {
return SkiaApi.sk_paint_is_stroke (Handle);
return SkiaApi.sk_paint_get_style (Handle) != SKPaintStyle.Fill;
}
set {
SkiaApi.sk_paint_set_stroke (Handle, value);
SkiaApi.sk_paint_set_style (Handle, value ? SKPaintStyle.Stroke : SKPaintStyle.Fill);
}
}
public SKPaintStyle Style {
get {
return SkiaApi.sk_paint_get_style (Handle);
}
set {
SkiaApi.sk_paint_set_style (Handle, value);
}
}

Просмотреть файл

@ -195,9 +195,9 @@ namespace SkiaSharp
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
public extern static void sk_paint_set_color(sk_paint_t t, SKColor color);
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
public extern static bool sk_paint_is_stroke(sk_paint_t t);
public extern static SKPaintStyle sk_paint_get_style(sk_paint_t t);
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
public extern static void sk_paint_set_stroke(sk_paint_t t, bool v);
public extern static void sk_paint_set_style(sk_paint_t t, SKPaintStyle style);
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
public extern static float sk_paint_get_stroke_width(sk_paint_t paint);
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]

2
skia

@ -1 +1 @@
Subproject commit 3343ae587f9da023dfd43ed1ab12dcddf0bd097b
Subproject commit 081595dac0040797ac8a964a75834f7d1c0b47d2