Gitlab CSE Unil

Commit d74066cb authored by M. Chardon's avatar M. Chardon
Browse files

maj couleur de la catégorie sur le rectangle geo

parent 8bc0d6d8
...@@ -105,9 +105,6 @@ define(["paper", "tools/Shape.class","adim/category"], function (paper, Shape, C ...@@ -105,9 +105,6 @@ define(["paper", "tools/Shape.class","adim/category"], function (paper, Shape, C
//setFill: _noop, //setFill: _noop,
//setStrokeWidth: _setStrokeWidth, //setStrokeWidth: _setStrokeWidth,
//getStrokeWidth: _getStrokeWidth, //getStrokeWidth: _getStrokeWidth,
}; };
// Add event listeners // Add event listeners
...@@ -119,7 +116,7 @@ define(["paper", "tools/Shape.class","adim/category"], function (paper, Shape, C ...@@ -119,7 +116,7 @@ define(["paper", "tools/Shape.class","adim/category"], function (paper, Shape, C
newRecGeo.onMouseDown = itemMouseDown; newRecGeo.onMouseDown = itemMouseDown;
newRecGeo.itemMouseDrag = itemMouseDrag; newRecGeo.itemMouseDrag = itemMouseDrag;
//newRecGeo.onPropertyChange = itemPropertyChange; newRecGeo.onPropertyChange = itemPropertyChange;
newRecGeo.style = { newRecGeo.style = {
fillColor: _getColorBg(properties.category), fillColor: _getColorBg(properties.category),
...@@ -307,6 +304,17 @@ define(["paper", "tools/Shape.class","adim/category"], function (paper, Shape, C ...@@ -307,6 +304,17 @@ define(["paper", "tools/Shape.class","adim/category"], function (paper, Shape, C
_editedSegmentIdx = null; _editedSegmentIdx = null;
} }
function itemPropertyChange(property, value) {
if (property === 'category') {
_setCategory.call(this, value);
this.style = {
fillColor: _getColorBg(value),
strokeColor: _getColor(value)
};
paper.view.draw();
}
}
function cancelCreate() { function cancelCreate() {
if (_drawingLine) if (_drawingLine)
_drawingLine.remove(); _drawingLine.remove();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment