mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-12 03:13:24 +01:00
fix loose marked/selection state on update bounds
This commit is contained in:
parent
898877d765
commit
5135d6bce8
1 changed files with 14 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import {setAttribute} from '../../../../../modules/scene/objectData';
|
||||
import {FACE, SHELL} from '../entites';
|
||||
import {SELECTION_COLOR, setFacesColor, SketchingView} from './faceView';
|
||||
import {NULL_COLOR, SELECTION_COLOR, setFacesColor, SketchingView} from './faceView';
|
||||
import {View} from './view';
|
||||
|
||||
export class OpenFaceShellView extends View {
|
||||
|
|
@ -58,9 +58,9 @@ export class OpenFaceView extends SketchingView {
|
|||
}
|
||||
|
||||
updateBounds() {
|
||||
let markedColor = this.color;
|
||||
this.dropGeometry();
|
||||
|
||||
|
||||
|
||||
let bounds2d = [];
|
||||
for (let mSketchObject of this.model.sketchObjects) {
|
||||
mSketchObject.sketchPrimitive.tessellate().forEach(p => bounds2d.push(p));
|
||||
|
|
@ -70,6 +70,9 @@ export class OpenFaceView extends SketchingView {
|
|||
surface.northEastPoint(), surface.northWestPoint()];
|
||||
|
||||
this.createGeometry();
|
||||
if (markedColor) {
|
||||
this.mark(markedColor);
|
||||
}
|
||||
}
|
||||
|
||||
updateSketch() {
|
||||
|
|
@ -89,6 +92,14 @@ export class OpenFaceView extends SketchingView {
|
|||
setFacesColor(this.mesh.geometry.faces, color);
|
||||
this.mesh.geometry.colorsNeedUpdate = true;
|
||||
}
|
||||
|
||||
get color() {
|
||||
let face = this.mesh && this.mesh.geometry && this.mesh.geometry.faces[0];
|
||||
if (face) {
|
||||
return face.color === NULL_COLOR ? null : face.color;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this.dropGeometry();
|
||||
|
|
|
|||
Loading…
Reference in a new issue