public override void RefreshAsNeeded(Diagram.ScaledInvalidate fnInvalidate) { base.RefreshAsNeeded(fnInvalidate); if (m_LastFractionDrawn != m_Engine.ElapsedTimerFraction) { fnInvalidate.Invoke(TimerRectangle()); } if (EventText != m_DrawnEventText || m_DrawnEventAlpha != EventAlpha()) { fnInvalidate.Invoke(EventRectangle()); } }
public override void RefreshAsNeeded(Diagram.ScaledInvalidate fnInvalidate) { base.RefreshAsNeeded(fnInvalidate); if (m_LastStateDrawn != m_Switch.State) { fnInvalidate.Invoke(StateArrowRectangle()); } }
public override void RefreshAsNeeded(Diagram.ScaledInvalidate fnInvalidate) { base.RefreshAsNeeded(fnInvalidate); if (m_LastFractionDrawn != m_Switch.ElapsedTimerFraction) { fnInvalidate.Invoke(TimerRectangle()); } }
public void RefreshAsNeeded(Diagram.ScaledInvalidate fnInvalidate) { if (LastDrawnState != EventState && LastDrawnAlpha > 0 || LastDrawnAlpha != EventAlpha()) { Point pt1 = new Point(From.Bounds.Right, From.Bounds.Y + From.Bounds.Height / 2); Point pt2 = new Point(To.Bounds.X, To.Bounds.Y + To.Bounds.Height / 2); int half = FLASHWIDTH / 2; Rectangle rct = new Rectangle(pt1.X - half, pt1.Y - half, FLASHWIDTH, FLASHWIDTH); // slightly clunky way of doing this, but don't think efficieny matters rct = Rectangle.Union(rct, new Rectangle(pt2.X - half, pt2.Y - half, FLASHWIDTH, FLASHWIDTH)); fnInvalidate.Invoke(rct); } }