mirror of
https://github.com/cds-astro/aladin-lite.git
synced 2026-06-12 11:01:37 -07:00
optimization preserveDrawingBuffer: false
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ name = "aladin-lite"
|
||||
description = "Aladin Lite v3 introduces a new graphical engine written in Rust with the use of WebGL"
|
||||
license = "BSD-3-Clause"
|
||||
repository = "https://github.com/cds-astro/aladin-lite"
|
||||
version = "3.8.2"
|
||||
version = "3.9.0"
|
||||
authors = [ "baumannmatthieu0@gmail.com", "matthieu.baumann@astro.unistra.fr",]
|
||||
edition = "2018"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "al-api"
|
||||
version = "3.8.2"
|
||||
version = "3.9.0"
|
||||
authors = ["baumannmatthieu0@gmail.com", "matthieu.baumann@astro.unistra.fr"]
|
||||
edition = "2018"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "al-core"
|
||||
version = "3.8.2"
|
||||
version = "3.9.0"
|
||||
authors = ["baumannmatthieu0@gmail.com", "matthieu.baumann@astro.unistra.fr"]
|
||||
edition = "2018"
|
||||
|
||||
|
||||
@@ -29,16 +29,15 @@ impl WebGlContext {
|
||||
.dyn_into::<web_sys::HtmlCanvasElement>()
|
||||
.unwrap_abort();
|
||||
|
||||
// See https://stackoverflow.com/a/26790802/13456997
|
||||
// preserveDrawingBuffer enabled for exporting the view as a PNG
|
||||
let context_options =
|
||||
js_sys::JSON::parse("{\"antialias\":false, \"preserveDrawingBuffer\": true}")?;
|
||||
//let context_options = js_sys::JSON::parse("{}")?;
|
||||
//let context_options =
|
||||
// js_sys::JSON::parse("{\"antialias\":false}")?;
|
||||
//js_sys::JSON::parse("{\"antialias\":false}")?;
|
||||
|
||||
#[cfg(feature = "webgl2")]
|
||||
let gl = Rc::new(
|
||||
canvas
|
||||
.get_context_with_context_options("webgl2", context_options.as_ref())?
|
||||
.get_context("webgl2")?
|
||||
.unwrap_abort()
|
||||
.dyn_into::<WebGlRenderingCtx>()
|
||||
.unwrap_abort(),
|
||||
|
||||
+5398
-5397
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -2211,7 +2211,7 @@ export let Aladin = (function () {
|
||||
* view in the counter clockwise order (or towards the east)
|
||||
*/
|
||||
Aladin.prototype.setRotation = function (rotation) {
|
||||
if (Utils.isNumber(rotation)) {
|
||||
if (!Utils.isNumber(rotation)) {
|
||||
console.warn("Rotation angle is not valid:", rotation)
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -581,6 +581,10 @@ export let View = (function () {
|
||||
};
|
||||
|
||||
View.prototype.getRawPixelsCanvas = function(width, height) {
|
||||
// important: redraw must be called just before getting the pixels
|
||||
// because the drawing buffer is not preserved (preserveDrawingBuffer = false)
|
||||
this.redraw()
|
||||
|
||||
const canvas = this.wasm.canvas();
|
||||
|
||||
const c = document.createElement('canvas');
|
||||
|
||||
Reference in New Issue
Block a user