kitchen-simulator 1.0.0-clark.67 → 1.0.0-clark.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,11 +16,11 @@ var STYLE_LINE = {
16
16
  // strokeWidth:1
17
17
  };
18
18
  var STYLE_INTERIOR_LINE = {
19
- strokeWidth: 1,
19
+ strokeWidth: 2,
20
20
  stroke: SharedStyle.INTERIOR_LINE.unselected
21
21
  };
22
22
  var STYLE_INTERIOR_LINE_SELECTED = {
23
- strokeWidth: 2,
23
+ strokeWidth: 4,
24
24
  stroke: SharedStyle.INTERIOR_LINE.selected,
25
25
  fill: SharedStyle.INTERIOR_LINE.selected,
26
26
  rx: '2px'
@@ -213,9 +213,9 @@ export default function WallFactory(name, info, textures) {
213
213
  })));
214
214
  return !element.selected ? /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("polygon", {
215
215
  points: "".concat(x1, ",").concat(y1, " ").concat(related0x, ",").concat(related0y, " ").concat(related1x, ",").concat(related1y, " ").concat(x2, ",").concat(y2),
216
- fill: "url(#pat)",
217
- fillRule: "evenodd"
218
- }), outwall, /*#__PURE__*/React.createElement("line", {
216
+ fill: "#CFD8DC"
217
+ // fillRule="evenodd"
218
+ }), /*#__PURE__*/React.createElement("line", {
219
219
  x1: x1,
220
220
  y1: y1,
221
221
  x2: x2,
@@ -223,9 +223,9 @@ export default function WallFactory(name, info, textures) {
223
223
  style: STYLE_INTERIOR_LINE
224
224
  })) : /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("polygon", {
225
225
  points: "".concat(x1, ",").concat(y1, " ").concat(related0x, ",").concat(related0y, " ").concat(related1x, ",").concat(related1y, " ").concat(x2, ",").concat(y2),
226
- fill: "url(#pat)",
227
- fillRule: "evenodd"
228
- }), outwall, /*#__PURE__*/React.createElement("line", {
226
+ fill: "#CFD8DC"
227
+ // fillRule="evenodd"
228
+ }), /*#__PURE__*/React.createElement("line", {
229
229
  x1: x1,
230
230
  y1: y1,
231
231
  x2: x2,
@@ -20,6 +20,7 @@ export default function (_ref) {
20
20
  alti = _ref.alti,
21
21
  obj_property = _ref.obj_property,
22
22
  outlineSVGData = _ref.outlineSVGData,
23
+ customer_property = _ref.customer_property,
23
24
  cds = _ref.cds;
24
25
  var _length = alti || 0;
25
26
  // const length = convert(_length).from("in").to("cm");
@@ -136,6 +137,7 @@ export default function (_ref) {
136
137
  img: base,
137
138
  obj: obj_property,
138
139
  cds: cds,
140
+ customer_property: customer_property,
139
141
  render2D: function render2D(element, layer, scene) {
140
142
  return render2DItem.call(this, element, layer, scene, sizeinfo, layoutpos, is_corner, shape_svg);
141
143
  },
@@ -354,8 +354,14 @@ export function render3DItem(element, layer, scene, sizeinfo, structure_json, is
354
354
  if (layer.toJS().counterTop.uri) {
355
355
  counterTop.uri = layer.toJS().counterTop.uri;
356
356
  }
357
- if ('name' in element.doorStyle) {
358
- doorStyles = new Map(element.doorStyle.doorStyles);
357
+ if (element.doorStyle.has('name')) {
358
+ var tempDoorStyle = element.doorStyle.toJS().doorStyles;
359
+ if (!tempDoorStyle.hasOwnProperty('base')) {
360
+ tempDoorStyle = _objectSpread(_objectSpread({}, tempDoorStyle), {}, {
361
+ base: ''
362
+ });
363
+ }
364
+ doorStyles = new Map(tempDoorStyle);
359
365
  color = element.doorStyle.color;
360
366
  glossness = element.doorStyle.glossness;
361
367
  handleMaterial.metalness = element.doorStyle.metalness;
package/es/class/item.js CHANGED
@@ -71,9 +71,7 @@ var Item = /*#__PURE__*/function () {
71
71
  }
72
72
  var setSizeOfItemByDoorStyle = function setSizeOfItemByDoorStyle() {
73
73
  var doorStyle = item.get('doorStyle').toJS();
74
- var euroCDS = state.catalog.getIn(['elements', type, 'cds']).data.filter(function (element) {
75
- return element && element.is_euro_cds;
76
- });
74
+ var euroCDS = state.catalog.getIn(['elements', type, 'customer_property']).is_euro_cds;
77
75
  if (doorStyle.door_style_name === 'Euro & Frameless' && euroCDS.length > 0) {
78
76
  var newProperties = item.get('properties').toJS();
79
77
  if (newProperties.hasOwnProperty('depth')) {
package/es/class/line.js CHANGED
@@ -501,7 +501,7 @@ var Line = /*#__PURE__*/function () {
501
501
  // let relatedLines = [];
502
502
  var vertices = state.getIn(['scene', 'layers', layerID, 'vertices']).toJS();
503
503
  var drawingLine = state.getIn(['scene', 'layers', layerID, 'lines', lineID]).toJS();
504
- var moveFlag = true;
504
+ var moveFlag = [];
505
505
  var tx = vertices[drawingLine.vertices[1]].x;
506
506
  var ty = vertices[drawingLine.vertices[1]].y;
507
507
  if (!isEmpty(relatedLines)) {
@@ -509,6 +509,7 @@ var Line = /*#__PURE__*/function () {
509
509
  vertices[drawingLine.vertices[1]].y = y;
510
510
  }
511
511
  var absAngle, lineAngle;
512
+ var angles = [];
512
513
 
513
514
  // get the angle of two lines and check the angle
514
515
  if (drawingLine.vertices[0] !== drawingLine.vertices[1]) {
@@ -520,9 +521,10 @@ var Line = /*#__PURE__*/function () {
520
521
  lineAngle = GeometryUtils.angleBetweenTwoLines(line, drawingLine, vertices);
521
522
  // check whether the angle is less than or bigger than specific value.
522
523
  absAngle = Math.abs(lineAngle);
524
+ angles.push(lineAngle);
523
525
  if (absAngle < MIN_ANGLE_DISALLOW_DRAW_WALL || absAngle > 360 - MIN_ANGLE_DISALLOW_DRAW_WALL) {
524
- moveFlag = false;
525
- } else moveFlag = true;
526
+ moveFlag.push(false);
527
+ } else moveFlag.push(true);
526
528
  }
527
529
  });
528
530
  } else {
@@ -534,23 +536,36 @@ var Line = /*#__PURE__*/function () {
534
536
  }
535
537
 
536
538
  // if the angle is bigger or less than specific value, the wall mustn't be drawn at new position
537
- if (moveFlag) {
539
+ if (!moveFlag.some(function (flag) {
540
+ return flag === false;
541
+ })) {
538
542
  tx = x;
539
543
  ty = y;
540
544
  } else {
541
- var rest = MIN_ANGLE_DISALLOW_DRAW_WALL - absAngle;
542
545
  // the origin point of rotation(snapping)
543
546
  var ox = vertices[drawingLine.vertices[0]].x;
544
547
  var oy = vertices[drawingLine.vertices[0]].y;
545
- // determine the direction of rotation.
546
- rest = lineAngle > 0 ? -rest : rest;
547
- // rotate the current point to last point around the first point of drawing line.
548
- var res = GeometryUtils.rotatePointAroundPoint(x, y, ox, oy, rest);
549
- tx = res.x;
550
- ty = res.y;
548
+ angles.forEach(function (angle, index) {
549
+ if (!moveFlag[index]) {
550
+ var absVal = Math.abs(angle);
551
+ var rest = MIN_ANGLE_DISALLOW_DRAW_WALL - absVal;
552
+ if (absVal > 360 - MIN_ANGLE_DISALLOW_DRAW_WALL) {
553
+ absVal = 360 - absVal;
554
+ rest = -(MIN_ANGLE_DISALLOW_DRAW_WALL - absVal);
555
+ }
556
+ // determine the direction of rotation.
557
+ rest = angle > 0 ? -rest : rest;
558
+ // rotate the current point to last point around the first point of drawing line.
559
+ var res = GeometryUtils.rotatePointAroundPoint(x, y, ox, oy, rest);
560
+ tx = res.x;
561
+ ty = res.y;
562
+ }
563
+ });
551
564
  }
552
565
  // angle snapping as a value of UNIT_ANGLE
553
- if (moveFlag && !isEmpty(absAngle) && absAngle % UNIT_ANGLE !== 0) {
566
+ if (!moveFlag.some(function (flag) {
567
+ return flag === false;
568
+ }) && !isEmpty(absAngle) && absAngle % UNIT_ANGLE !== 0) {
554
569
  var result = GeometryUtils.snapAngleByUnit(lineAngle, vertices, drawingLine, tx, ty, drawingLine.vertices[1]);
555
570
  tx = result.x;
556
571
  ty = result.y;
@@ -22,7 +22,7 @@ export default function GridStreak(_ref) {
22
22
  key: i,
23
23
  cx: x,
24
24
  cy: y,
25
- r: 1.5,
25
+ r: 2,
26
26
  fill: color
27
27
  }));
28
28
  }
@@ -118,11 +118,11 @@ export default function Item(_ref, _ref2) {
118
118
  var selectedItem;
119
119
  if (layer.selected.items.size > 0) {
120
120
  selectedItem = layer.getIn(['items', layer.selected.items.get(0)]);
121
- var catid = selectedItem.type;
122
- var cat = findCatalogElement(catalog, catid);
121
+ var _catid = selectedItem.type;
122
+ var _cat = findCatalogElement(catalog, _catid);
123
123
  currentItem = {
124
124
  selectedItem: selectedItem,
125
- cat: cat
125
+ cat: _cat
126
126
  };
127
127
  }
128
128
  layer.items.forEach(function (item) {
@@ -260,7 +260,7 @@ export default function Item(_ref, _ref2) {
260
260
  if (GeometryUtils.pointsDistance(p0.x, p0.y, p1.x, p1.y) > GeometryUtils.pointsDistance(p0.x, p0.y, coordinatePoint.x, coordinatePoint.y) && GeometryUtils.pointsDistance(p0.x, p0.y, p1.x, p1.y) > GeometryUtils.pointsDistance(p1.x, p1.y, coordinatePoint.x, coordinatePoint.y)) {
261
261
  if (GeometryUtils.pointsDistance(coordinatePoint.x, coordinatePoint.y, center_x, center_y) > GeometryUtils.pointsDistance(centerpoint[0].x, centerpoint[0].y, coordinatePoint.x, coordinatePoint.y)) {
262
262
  comparelength.push(GeometryUtils.pointsDistance(centerpoint[0].x, centerpoint[0].y, coordinatePoint.x, coordinatePoint.y));
263
- a = Math.min.apply(null, comparelength);
263
+ a = Math.max.apply(null, comparelength);
264
264
  }
265
265
  }
266
266
  }
@@ -275,8 +275,13 @@ export default function Item(_ref, _ref2) {
275
275
  var nh = height / 2;
276
276
  var _getDistant = getDistant(x, y, val.rotRad),
277
277
  PointArray = _getDistant.PointArray;
278
+ var catid = item.type;
279
+ var cat = catalog.elements[catid];
278
280
  PointArray.forEach(function (pointElement, index) {
279
281
  if (pointElement[0] == undefined) PointArray[index][0] = 0;
282
+ if (pointElement[1] === -90 && cat.info.is_corner !== 1) {
283
+ PointArray[index][0] -= 4;
284
+ }
280
285
  });
281
286
  if (Array.isArray(PointArray)) {
282
287
  itemsActions.storeDistArray(layerID, id, PointArray);
@@ -305,7 +310,7 @@ export default function Item(_ref, _ref2) {
305
310
  length: itemDistanceFromLine,
306
311
  angle: rotation,
307
312
  rotation: element[1],
308
- transform: "translate(".concat(element[1] === 180 ? -nw : element[1] === 0 ? nw : 0, ", ").concat(element[1] === 90 ? nh : element[1] === -90 ? -nh : 3 * nh / 4, ") rotate(").concat(element[1], ", 0, 0)")
313
+ transform: "translate(".concat(element[1] === 180 ? -nw : element[1] === 0 ? nw : 0, ", ").concat(element[1] === 90 ? nh : element[1] === -90 ? cat.info.is_corner !== 1 ? -(nh + 4) : -nh : 0, ") rotate(").concat(element[1], ", 0, 0)")
309
314
  })));
310
315
  }
311
316
  });