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
//setFill: _noop,
//setStrokeWidth: _setStrokeWidth,
//getStrokeWidth: _getStrokeWidth,
};
// Add event listeners
......@@ -119,7 +116,7 @@ define(["paper", "tools/Shape.class","adim/category"], function (paper, Shape, C
newRecGeo.onMouseDown = itemMouseDown;
newRecGeo.itemMouseDrag = itemMouseDrag;
//newRecGeo.onPropertyChange = itemPropertyChange;
newRecGeo.onPropertyChange = itemPropertyChange;
newRecGeo.style = {
fillColor: _getColorBg(properties.category),
......@@ -307,6 +304,17 @@ define(["paper", "tools/Shape.class","adim/category"], function (paper, Shape, C
_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() {
if (_drawingLine)
_drawingLine.remove();
......
Markdown is supported
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