mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-21 01:13:37 +08:00
Fix #1804 Centering view on empty project corrupts view
Reset Zoom on UV editor now also resets position
This commit is contained in:
parent
b745465bea
commit
7128d69f74
@ -610,6 +610,10 @@ function setZoomLevel(mode) {
|
||||
case 'reset': zoom = 1; break;
|
||||
}
|
||||
UVEditor.setZoom(zoom);
|
||||
if (mode == 'reset') {
|
||||
Project.uv_viewport.offset.V2_set(0, 0);
|
||||
UVEditor.loadViewportOffset();
|
||||
}
|
||||
|
||||
} else if (Prop.active_panel == 'timeline') {
|
||||
|
||||
|
@ -68,7 +68,7 @@ function getSelectionCenter(all = false) {
|
||||
min[2] = Math.min(pos.z, min[2]); max[2] = Math.max(pos.z, max[2]);
|
||||
}
|
||||
})
|
||||
let center = max.V3_add(min).V3_divide(2);
|
||||
let center = (min[0] == Infinity) ? [0, 0, 0] : max.V3_add(min).V3_divide(2);
|
||||
|
||||
if (!Format.centered_grid) {
|
||||
center.V3_add(8, 8, 8)
|
||||
|
Loading…
Reference in New Issue
Block a user