Skip to content

Commit

Permalink
Merge pull request #2646 from Nestorboy/fix-java-brush-matrix
Browse files Browse the repository at this point in the history
Fixed Java brush matrix
  • Loading branch information
JannisX11 authored Jan 20, 2025
2 parents 3039c28 + ee80888 commit fac8535
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/preview/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -1153,11 +1153,11 @@ class Preview {

let z_offset = world_normal.clone().multiplyScalar(z_fight_offset);
let matrix_offset = new THREE.Matrix4().makeTranslation(z_offset.x, z_offset.y, z_offset.z);
if (!Format.centered_grid) {
matrix_offset.makeTranslation(-Canvas.scene.position.x, -Canvas.scene.position.y, -Canvas.scene.position.z);
}
brush_matrix.multiplyMatrices(matrix_offset, brush_matrix);

// Since we're setting the brush matrix, we need to multiply in its parents matrix as well in case there are any.
if (Canvas.brush_outline.parent)
brush_matrix.multiplyMatrices(Canvas.brush_outline.parent.matrixWorld.clone().invert(), brush_matrix);
Canvas.brush_outline.matrix = brush_matrix;
}

Expand Down

0 comments on commit fac8535

Please sign in to comment.