remove resize observer throttling

This commit is contained in:
Matthieu Baumann
2024-03-26 11:21:18 +01:00
parent 5efcb20b5c
commit 08a9c290ee
5 changed files with 8 additions and 4 deletions

View File

@@ -24,6 +24,7 @@
gridOptions: {color: 'pink'},
showCooGrid: true, // set the grid
fullScreen: true,
showStatusBar: false,
showShareControl: true,
showSettingsControl: true,
showLayersControl: true,

View File

@@ -33,7 +33,7 @@
],
"scripts": {
"wasm": "wasm-pack build ./src/core --target web --release --out-name core -- --features webgl2 -Z build-std=panic_abort,std -Z build-std-features=panic_immediate_abort ",
"predeploy": "npm run build && rm -rf aladin-lite.tgz && npm pack",
"predeploy": "npm run build && rm -rf aladin-lite*.tgz && npm pack",
"deploy": "python3 deploy/deploy.py",
"build": "npm run wasm && vite build && cp examples/index.html dist/index.html",
"dev": "npm run build && vite",

View File

@@ -1120,7 +1120,7 @@ canvas {
.aladin-location {
position: absolute;
top: 0.2rem;
left: 7.15rem;
left: 6.9rem;
font-family: monospace;
color: white;

View File

@@ -618,6 +618,8 @@ export let Aladin = (function () {
this.view.setZoom(FoV);
};
Aladin.prototype.setFov = Aladin.prototype.setFoV;
// @API
// (experimental) try to adjust the FoV to the given object name. Does nothing if object is not known from Simbad
Aladin.prototype.adjustFovForObject = function (objectName) {

View File

@@ -234,8 +234,9 @@ export let View = (function () {
let doit;
this.resizeObserver = new ResizeObserver(() => {
clearTimeout(doit);
doit = setTimeout(resizeLayout, 100);
//clearTimeout(doit);
//doit = setTimeout(resizeLayout, 100);
resizeLayout();
});
self.resizeObserver.observe(this.aladinDiv)