mirror of
https://github.com/tuna/mirror-web.git
synced 2025-12-26 05:02:48 +00:00
Fix firefox dimension calculation
This commit is contained in:
parent
5e7f81f61f
commit
a4673145ee
|
|
@ -539,8 +539,10 @@ function reassemble() {
|
|||
var vbox = sym.viewBox.baseVal;
|
||||
// TODO: handle browsers without baseVal
|
||||
// TODO: handle origins other than 0,0
|
||||
var scale = width / vbox.width;
|
||||
var vscale = height / vbox.height;
|
||||
// Firefox fucks up its dimension calculation
|
||||
var parentDims = trace.parentElement.getBoundingClientRect();
|
||||
var scale = parentDims.width / vbox.width;
|
||||
var vscale = parentDims.height / vbox.height;
|
||||
// if(scale > vscale * 1.01 || scale < vscale * 0.99)
|
||||
// console.warn(`incompatible scales: ${scale}, ${vscale}`);
|
||||
var paths = symbolCache[sym.id];
|
||||
|
|
|
|||
|
|
@ -553,8 +553,11 @@ function reassemble() {
|
|||
// TODO: handle browsers without baseVal
|
||||
// TODO: handle origins other than 0,0
|
||||
|
||||
const scale = width / vbox.width;
|
||||
const vscale = height / vbox.height;
|
||||
// Firefox fucks up its dimension calculation
|
||||
const parentDims = trace.parentElement!.getBoundingClientRect();
|
||||
|
||||
const scale = parentDims.width / vbox.width;
|
||||
const vscale = parentDims.height / vbox.height;
|
||||
// if(scale > vscale * 1.01 || scale < vscale * 0.99)
|
||||
// console.warn(`incompatible scales: ${scale}, ${vscale}`);
|
||||
const paths: string[] | undefined = symbolCache[sym.id];
|
||||
|
|
|
|||
Loading…
Reference in New Issue