Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic DiagramLink Draw() Pen flicker (Read 2103 times)
j poz
Junior Member
**
Offline


I Love MindFusion!

Posts: 78
Joined: Nov 21st, 2012
DiagramLink Draw() Pen flicker
Aug 11th, 2014 at 3:23pm
Print Post  
I am overriding the Draw() method of DiagramLink, and doing something like this:

Code
Select All
public override void Draw(MindFusion.Drawing.IGraphics graphics, RenderOptions options)
{
             if (DragOver)
            {
                Pen = YellowPen;
                HeadPen = YellowPen;
            }
            else
            {
                Pen = BlackPen;
                HeadPen = BlackPen;
            }

             base.Draw(graphics, options);
} 



The problem is that when DragOver is true, the link is being drawn in yellow but flickering between black and yellow as I drag over it.

How do I stop it from flickering like this?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramLink Draw() Pen flicker
Reply #1 - Aug 12th, 2014 at 2:19pm
Print Post  
You might be seeing the black color from the view's bitmap buffer used for fast redrawing of stationary items during modification of the active item. Try calling the RecreateCacheImage method from each NodeModifying event if you set the DragOver flag while moving nodes, or better call it only when a link has to be redrawn because a node moves over / away from it.
  
Back to top
 
IP Logged
 
j poz
Junior Member
**
Offline


I Love MindFusion!

Posts: 78
Joined: Nov 21st, 2012
Re: DiagramLink Draw() Pen flicker
Reply #2 - Aug 12th, 2014 at 4:48pm
Print Post  
You're right, that was it. Thank you.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint