Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrowDecorator.setColor has no effect #35

Closed
JoeKuan-itrinegy opened this issue Jun 18, 2019 · 1 comment
Closed

ArrowDecorator.setColor has no effect #35

JoeKuan-itrinegy opened this issue Jun 18, 2019 · 1 comment

Comments

@JoeKuan-itrinegy
Copy link

The setColor method in draw2d.decoration.connection.ArrowDecorator doesn't work at all. The stroke color is taken from the line color of the connection.

The issue is in draw2.Connection.repaint method

	    if(this.sourceDecoratorNode!==null){
	    	var start = this.getVertices().first();
	  	    this.sourceDecoratorNode.transform("r"+this.getStartAngle()+"," + start.x + "," + start.y +" t" + start.x + "," + start.y);
	  	    // propagate the color and the opacity to the decoration as well
	  	    this.sourceDecoratorNode.attr({"stroke":"#"+this.lineColor.hex(), opacity:this.alpha});
            this.sourceDecoratorNode.forEach(function(shape){
                shape.node.setAttribute("class",_this.cssClass!==null?_this.cssClass:"");
            });
	    }
	    
        if(this.targetDecoratorNode!==null){
	    	var end = this.getVertices().last();
            this.targetDecoratorNode.transform("r"+this.getEndAngle()+"," + end.x + "," + end.y+" t" + end.x + "," + end.y);
            this.targetDecoratorNode.attr({"stroke":"#"+this.lineColor.hex(), opacity:this.alpha});
            this.targetDecoratorNode.forEach(function(shape){
                shape.node.setAttribute("class",_this.cssClass!==null?_this.cssClass:"");
            });
        }

this.targetDecoratorNode.attr and this.sourceDecoratorNode.attr set the 'stroke' attribute with the lineColor instead

@freegroup
Copy link
Owner

freegroup commented Feb 25, 2020

fixed with v1.0.24

Bildschirmfoto 2020-02-25 um 12 34 55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants