public void EndDrawing() { if (_eshape != null) { _eshape.End (); _eshape = null; } var toRemove = new List<object> (); foreach (var k in _shapes.Keys) { if (!_drawnShapes.ContainsKey (k)) { toRemove.Add (k); } } foreach (var k in toRemove) { // Log.println ("Clearing " + k); var s = _shapes[k]; s.Clear (); _shapes.Remove (k); } }
public void BeginEntity(object entity) { var font = default(Font); if (_eshape != null) { _eshape.End (); font = _eshape.CurrentFont; _eshape = null; } EntityShapes eshape = null; if (!_shapes.TryGetValue (entity, out eshape)) { eshape = new EntityShapes (entity, _canvas); _shapes[entity] = eshape; } _eshape = eshape; if (font != null) _eshape.SetFont(font); _drawnShapes.Add (entity, _eshape); _eshape.Begin (); }