Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Selection flickering issue (Read 1235 times)
j poz
Junior Member
**
Offline


I Love MindFusion!

Posts: 78
Joined: Nov 21st, 2012
Selection flickering issue
Mar 21st, 2013 at 10:01pm
Print Post  
I am having an issue with dragging multiple selection items over a container, used in conjunction with SelectionOnTop.

I have reproduced this issues using the Demo app. Please open the attached XML. Select both the shape nodes on the left. Drag them over the containers and then, without letting go of the mouse to drop them, pause directly over the two containers. One of the shape nodes disappears behind the container. If you try moving you will also notice it flickers a lot as you move. It seems like only the main selected node is shown with the correct zindex.
  

Selection_Flickering.zip (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Selection flickering issue
Reply #1 - Mar 22nd, 2013 at 12:25pm
Print Post  
The problem seems to be that during normal painting in response to OnPaint the control draws only the ActiveItem on top, while during MouseMove painting it draws all selected items on top to better show what's being moved. When a container's highlight state changes, it manages to invalidate the view, getting WM_PAINT / OnPaint notification in between the mouse move ones and causing flickering if containers are higher in the Z order. For the time being you could override the view's OnPaint to always draw the modified items on top:

Code
Select All
class MyView : DiagramView
{
	protected override void OnPaint(PaintEventArgs pe)
	{
		base.OnPaint(pe);

		if (Diagram.Interaction != null)
		{
			var g = new GdiGraphics(pe.Graphics);
			g.PageUnit = Diagram.MeasureUnit;
			float scale = ZoomFactor / 100F;
			g.ScaleTransform(scale, scale);
			g.TranslateTransform(-ScrollX, -ScrollY);

			// this is usually called only from MouseMove
			Diagram.DrawInteraction(
				g, new RenderOptions(), pe.ClipRectangle);
		}
	}
} 



Our developers will try to fix this for the next release in a couple of weeks.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint