Skip to content

Commit f5edc5e

Browse files
committed
Fix #408 transpose matrix data before copying
1 parent fccbd72 commit f5edc5e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/app/pages/Transformation.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { Matrix3, Matrix4, Mesh, Quad, Renderer, ShaderProgram, Vector, Vertex } from 'deepslate'
22
import { mat4, quat, vec3 } from 'gl-matrix'
33
import { useCallback, useMemo, useRef, useState } from 'preact/hooks'
4+
import { composeMatrix, svdDecompose } from '../Utils.js'
45
import { Footer, NumberInput, Octicon, RangeInput } from '../components/index.js'
56
import { InteractiveCanvas3D } from '../components/previews/InteractiveCanvas3D.jsx'
67
import { useLocale, useTitle } from '../contexts/index.js'
78
import { useActiveTimeout } from '../hooks/useActiveTimout.js'
89
import { useAsync } from '../hooks/useAsync.js'
910
import { loadImage } from '../services/DataFetcher.js'
10-
import { composeMatrix, svdDecompose } from '../Utils.js'
1111

1212
const XYZ = ['x', 'y', 'z'] as const
1313
type XYZ = typeof XYZ[number]
@@ -163,7 +163,8 @@ export function Transformation({}: Props) {
163163

164164
const [copiedComposed, setCopiedComposed] = useActiveTimeout()
165165
const onCopyComposed = useCallback(() => {
166-
navigator.clipboard.writeText(`[${[...matrix.data].map(formatFloat).join(',')}]`)
166+
const matrixData = matrix.clone().transpose().data
167+
navigator.clipboard.writeText(`[${[...matrixData].map(formatFloat).join(',')}]`)
167168
.then(() => setCopiedComposed())
168169
}, [matrix, setCopiedComposed])
169170

0 commit comments

Comments
 (0)