Fixed reference bug.
This commit is contained in:
@@ -2,7 +2,7 @@ import { Points } from '../../utils.js'
|
||||
import { EventHandler } from './utils.js'
|
||||
import { FlagPolygon } from '../graphics/label.js'
|
||||
import { DeepZoomMap } from './map.js'
|
||||
import { PIXIUtils } from '../../../../js/pixi/utils.js'
|
||||
import { PIXIUtils } from './utils.js'
|
||||
|
||||
/**
|
||||
* * GeoGraphics are graphical objects, that does not store the graphics information
|
||||
|
||||
@@ -225,9 +225,9 @@ export default class MapApp extends PIXIApp {
|
||||
sceneFactory() {
|
||||
return new RigidScatterContainer(this.width, this.height, this.renderer, {
|
||||
app: this,
|
||||
showBounds: true,
|
||||
showTouches: true,
|
||||
showPolygon: true,
|
||||
showBounds: false,
|
||||
showTouches: false,
|
||||
showPolygon: false,
|
||||
container: this
|
||||
})
|
||||
}
|
||||
|
||||
@@ -258,6 +258,31 @@ export class Vector {
|
||||
}
|
||||
}
|
||||
|
||||
export class PIXIUtils {
|
||||
/*
|
||||
* Transform a pixi text to it's actual screensize,
|
||||
* ignoring it's local transforms
|
||||
*/
|
||||
static toScreenFontSize(pixiText, fontSize = null) {
|
||||
pixiText._recursivePostUpdateTransform();
|
||||
|
||||
let normalizedScale = {
|
||||
x: pixiText.scale.x / pixiText.transform.worldTransform.a,
|
||||
y: pixiText.scale.x / pixiText.transform.worldTransform.d
|
||||
};
|
||||
|
||||
pixiText.scale = { x: normalizedScale.x, y: normalizedScale.y };
|
||||
if (fontSize) pixiText.style.fontSize = fontSize;
|
||||
}
|
||||
|
||||
static saveFill(graphics) {
|
||||
return {
|
||||
fill: graphics.fill.color,
|
||||
alpha: graphics.fill.alpha
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The EventHandler class is used to take care of a event based design
|
||||
* pattern. Callbacks can subscribe to an event and these unknown sources
|
||||
|
||||
Reference in New Issue
Block a user