fix initial scale/translate algorithm
This commit is contained in:
parent
7af5972765
commit
e30d05f71d
1 changed files with 5 additions and 5 deletions
|
@ -173,13 +173,13 @@ const Visualize = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const queryParams = Util.queryParams()
|
const queryParams = Util.queryParams()
|
||||||
if (typeof queryParams.scale === 'string') {
|
const scale = parseFloat(queryParams.scale) || 1.0
|
||||||
const scale = parseFloat(queryParams.scale) || 0
|
|
||||||
self.mGraph.canvas.scale(scale, scale)
|
|
||||||
}
|
|
||||||
if (typeof queryParams.translate === 'string') {
|
if (typeof queryParams.translate === 'string') {
|
||||||
const [x, y] = queryParams.translate.split(',').map(n => parseFloat(n) || 0)
|
const [x, y] = queryParams.translate.split(',').map(n => parseFloat(n) || 0)
|
||||||
self.mGraph.canvas.translate(x, y)
|
self.mGraph.canvas.translate(x / scale, y / scale)
|
||||||
|
}
|
||||||
|
if (typeof queryParams.scale === 'string') {
|
||||||
|
self.mGraph.canvas.scale(scale, scale)
|
||||||
}
|
}
|
||||||
|
|
||||||
function runAnimation() {
|
function runAnimation() {
|
||||||
|
|
Loading…
Reference in a new issue