- Make up for PR #564.
- Fixes part of #779.
This commit is contained in:
H1Gdev 2021-01-11 16:54:37 +09:00 коммит произвёл GitHub
Родитель 197d4dca72
Коммит 61b933bcd8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 5 добавлений и 2 удалений

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

@ -72,7 +72,9 @@ namespace Svg
_concreteServer = styleOwner.OwnerDocument.IdManager.GetElementById(DeferredId) as SvgPaintServer;
_fallbackServer = FallbackServer;
if (!(_fallbackServer is SvgColourServer ||
if (_fallbackServer == null)
_fallbackServer = None;
else if (!(_fallbackServer is SvgColourServer ||
(_fallbackServer is SvgDeferredPaintServer && string.Equals(((SvgDeferredPaintServer)_fallbackServer).DeferredId, "currentColor"))))
_fallbackServer = Inherit;
}
@ -83,7 +85,7 @@ namespace Svg
public override Brush GetBrush(SvgVisualElement styleOwner, ISvgRenderer renderer, float opacity, bool forStroke = false)
{
EnsureServer(styleOwner);
return (_concreteServer ?? _fallbackServer ?? NotSet).GetBrush(styleOwner, renderer, opacity, forStroke);
return _concreteServer?.GetBrush(styleOwner, renderer, opacity, forStroke) ?? _fallbackServer?.GetBrush(styleOwner, renderer, opacity, forStroke) ?? NotSet?.GetBrush(styleOwner, renderer, opacity, forStroke);
}
public override SvgElement DeepCopy()

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

@ -20,6 +20,7 @@ The release versions are NuGet releases.
(see [#634](https://github.com/vvvv/SVG/issues/634)
* fixed rendering of text-anchor `middle` (see [#769](https://github.com/vvvv/SVG/issues/769)
* fixed opacity not correctly inherited issue (see [#777](https://github.com/vvvv/SVG/issues/777) and [PR #788](https://github.com/vvvv/SVG/pull/788))
* fixed fallback color (see [#779](https://github.com/vvvv/SVG/issues/779) and [PR #792](https://github.com/vvvv/SVG/pull/792))
## [Version 3.1.1](https://www.nuget.org/packages/Svg/3.1.1)