Remove background color when change to line shape

This commit is contained in:
Paulo Gustavo Veiga 2022-01-03 17:27:54 -08:00
parent 110005be4b
commit 36aa4fc7ab
3 changed files with 11 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@wisemapping/mindplot",
"version": "0.4.8",
"version": "0.4.9",
"description": "WiseMapping - Mindplot Canvas Library",
"homepage": "http://www.wisemapping.org/",
"main": "dist/main.js",

View File

@ -22,6 +22,7 @@ import ActionDispatcher from './ActionDispatcher';
class ShirinkConnector {
constructor(topic) {
this._isShrink = false;
const ellipse = new Elipse(TopicConfig.INNER_RECT_ATTRIBUTES);
this._ellipse = ellipse;
ellipse.setFill('rgb(62,118,179)');
@ -49,12 +50,11 @@ class ShirinkConnector {
});
ellipse.addEvent('mouseover', () => {
ellipse.setFill('rgb(153, 0, 255)');
ellipse.setStroke(this._isShrink ? 1 : 2, 'solid');
});
const me = this;
ellipse.addEvent('mouseout', () => {
const color = topic.getBackgroundColor();
me.setFill(color);
ellipse.setStroke(this._isShrink ? 2 : 1, 'solid');
});
ellipse.setCursor('default');
@ -70,6 +70,7 @@ class ShirinkConnector {
} else {
elipse.setStroke('1', 'solid');
}
this._isShrink = isShrink;
}
setVisibility(value) {

View File

@ -110,6 +110,11 @@ class Topic extends NodeGraph {
if ($defined(updateModel) && updateModel) {
model.setShapeType(type);
}
// If shape is line, reset background color to default.
if (type === TopicShape.LINE) {
const color = TopicStyle.defaultBackgroundColor(this);
this.setBackgroundColor(color);
}
const oldInnerShape = this.getInnerShape();
if (oldInnerShape != null) {