Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Fill brush of anchor point (Read 1188 times)
Davaaron
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 42
Joined: Jul 12th, 2018
Fill brush of anchor point
Aug 21st, 2018 at 9:38am
Print Post  
Hi,

is there any way to fill an anchor point with a specified color? I
've managed to set the stroke of it by using "setColor" but couldn't find any way to fill the background with the same color.

Thanks in advance.
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Fill brush of anchor point
Reply #1 - Aug 21st, 2018 at 12:23pm
Print Post  
Hi,

You can override the method that creates the anchor points visuals and assign a custom background color, before passing it back. Something like:
Code (Javascript)
Select All
var originalCreateAnchorPointVisual = MindFusion.Diagramming.ShapeNode.prototype.createAnchorPointVisual;
MindFusion.Diagramming.ShapeNode.prototype.createAnchorPointVisual = function (point)
{
    var path = originalCreateAnchorPointVisual.apply(this, [point]);
    if (path)
        path.brush = "#c0c0c0";

    return path;
}; 



Regards,
Lyubo
  
Back to top
 
IP Logged
 
Davaaron
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 42
Joined: Jul 12th, 2018
Re: Fill brush of anchor point
Reply #2 - Aug 21st, 2018 at 12:58pm
Print Post  
Works like a charm. Thanks!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint