internal void _UpdateSync(PresentationVisual visual) { visual.Update(); foreach (var primitive in visual.Context.Primitives) { if (!_bounds.IsIntersectWith(primitive)) { continue; } var bounds = GeometryHelper.RestrictBounds(_bounds, primitive.Property.Bounds); _DrawPrimitive(primitive, bounds); _UpdateBounds(bounds); } }
internal void _UpdateAsync(PresentationVisual visual) { if (visual.Mode != Mode.WatingForUpdate) { return; } visual.Mode = Mode.Updating; visual.Update(); foreach (var primitive in visual.Context.Primitives) { if (_currentSource.IsCancellationRequested) { break; } if (!_bounds.IsIntersectWith(primitive)) { continue; } var bounds = GeometryHelper.RestrictBounds(_bounds, primitive.Property.Bounds); _DrawPrimitive(primitive, bounds); } visual.Mode = Mode.Completed; }