kitchen-simulator 7.0.7-react-18 → 7.0.8-react-18
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.
package/es/WorkSpaceHostMimic.js
CHANGED
|
@@ -38,6 +38,10 @@ export default function WorkSpaceHostMimic() {
|
|
|
38
38
|
var _api$__render;
|
|
39
39
|
var api = apiRef.current;
|
|
40
40
|
if (!api) return;
|
|
41
|
+
console.log({
|
|
42
|
+
width: window.innerWidth,
|
|
43
|
+
height: window.innerHeight
|
|
44
|
+
});
|
|
41
45
|
(_api$__render = api.__render) === null || _api$__render === void 0 || _api$__render.call(api, {
|
|
42
46
|
width: window.innerWidth,
|
|
43
47
|
height: window.innerHeight,
|
package/es/class/project.js
CHANGED
|
@@ -145,14 +145,26 @@ var Project = /*#__PURE__*/function () {
|
|
|
145
145
|
var h = bb.maxY - bb.minY;
|
|
146
146
|
if (w != 0 && Math.abs(w) != Infinity && h != 0 && Math.abs(h) != Infinity) {
|
|
147
147
|
a = viewer.viewerHeight < h ? viewer.viewerHeight / h : (viewer.viewerHeight / h * 3 / 5 - 0.5) / constants.ZOOM_VARIABLE > 400 ? viewer.viewerHeight / h * 400 / ((viewer.viewerHeight / h - 0.5) / constants.ZOOM_VARIABLE) : viewer.viewerHeight / h * 3 / 5;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
148
|
+
var scaledWidth = a * viewer.SVGWidth;
|
|
149
|
+
var scaledHeight = a * viewer.SVGHeight;
|
|
150
|
+
|
|
151
|
+
// Horizontal
|
|
152
|
+
if (scaledWidth <= viewer.viewerWidth) {
|
|
153
|
+
e = (viewer.viewerWidth - scaledWidth) / 2;
|
|
154
|
+
} else {
|
|
155
|
+
var maxE = 10;
|
|
156
|
+
var minE = viewer.viewerWidth - (scaledWidth + 10);
|
|
157
|
+
e = Math.min(maxE, Math.max(minE, e));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Vertical
|
|
161
|
+
if (scaledHeight <= viewer.viewerHeight) {
|
|
162
|
+
f = (viewer.viewerHeight - scaledHeight) / 2;
|
|
163
|
+
} else {
|
|
164
|
+
var maxF = 80;
|
|
165
|
+
var minF = viewer.viewerHeight - (scaledHeight + 10);
|
|
166
|
+
f = Math.min(maxF, Math.max(minF, f));
|
|
167
|
+
}
|
|
156
168
|
_viewer2D = _viewer2D.merge({
|
|
157
169
|
a: a,
|
|
158
170
|
d: a,
|
|
@@ -171,6 +183,7 @@ var Project = /*#__PURE__*/function () {
|
|
|
171
183
|
doorStyle: doorStyle,
|
|
172
184
|
viewer2D: _viewer2D
|
|
173
185
|
});
|
|
186
|
+
state = centering2D(state, viewer2DActions);
|
|
174
187
|
state = Item.setCounterTop(state, counterTop).updatedState;
|
|
175
188
|
state = Area.setFloorStyles(state, floorStyle).updatedState;
|
|
176
189
|
this.updateZoomScale(state, a);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { CHANGE_BASE_CABINET_MEASURE, CHANGE_WALL_CABINET_MEASURE, CHANGE_WALL_LENGTH_MEASURE, CHANGE_WINDOW_DOOR_MEASURE, MODE_2D_PAN, MODE_2D_ZOOM_IN, MODE_2D_ZOOM_OUT, SELECT_TOOL_PAN, SELECT_TOOL_ZOOM_IN, SELECT_TOOL_ZOOM_OUT, UPDATE_2D_CAMERA, UPDATE_CEIL_HEIGHT, UPDATE_CEIL_HEIGHT_UNIT } from "../constants";
|
|
2
2
|
import { convert } from "../utils/convert-units-lite";
|
|
3
|
+
import { centering2D } from "../utils/helper";
|
|
4
|
+
import * as viewer2DActions from "../actions/viewer2d-actions";
|
|
3
5
|
export default function (state, action) {
|
|
4
6
|
var _state = state,
|
|
5
7
|
scene = _state.scene;
|