mirror of
https://github.com/cds-astro/aladin-lite.git
synced 2026-01-06 01:58:22 -08:00
fix pixel missing
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
aladin.setBaseImageLayer("P/PanSTARRS/DR1/g", {imgFormat: "fits"});
|
||||
aladin.getBaseImageLayer().setColormap('redtemperature', {stretch: "Asinh"});*/
|
||||
|
||||
aladin = A.aladin('#aladin-lite-div', {survey: 'P/PanSTARRS/DR1/g', fov: 360, target: '0 90', fullScreen: true, cooFrame: 'equatorial', showCooGridControl: true, showSimbadPointerControl: true, showCooGrid: true});
|
||||
aladin = A.aladin('#aladin-lite-div', {survey: 'CDS/P/SDSS9/color', fov: 60, target: '0 90', fullScreen: true, cooFrame: 'equatorial', showCooGridControl: true, showSimbadPointerControl: true, showCooGrid: true});
|
||||
aladin.setProjection('SIN');
|
||||
|
||||
//let survey = aladin.createImageSurvey("P/PanSTARRS/DR1/g", null, null, null, null, );
|
||||
|
||||
@@ -93,16 +93,12 @@ impl CameraViewPort {
|
||||
let window = web_sys::window().unwrap();
|
||||
let width = window.inner_width().unwrap().as_f64().unwrap() as f32;
|
||||
let height = window.inner_height().unwrap().as_f64().unwrap() as f32;
|
||||
// Clamp it to 3 at maximum, this for limiting the number of pixels drawn
|
||||
let dpi = if window.device_pixel_ratio() as f32 > MAX_DPI_LIMIT {
|
||||
MAX_DPI_LIMIT
|
||||
} else {
|
||||
window.device_pixel_ratio() as f32
|
||||
};
|
||||
// Clamp it to 3 at maximum, this for limiting the number of pixels drawn
|
||||
|
||||
/*if width < height {
|
||||
dpi = 1.0;
|
||||
}*/
|
||||
|
||||
let width = width * dpi;
|
||||
let height = height * dpi;
|
||||
@@ -286,10 +282,11 @@ impl CameraViewPort {
|
||||
}
|
||||
|
||||
aperture
|
||||
} else if !P::ALLOW_UNZOOM_MORE {
|
||||
P::aperture_start()
|
||||
} else {
|
||||
self.clip_zoom_factor = (aperture / P::aperture_start()).0;
|
||||
if P::ALLOW_UNZOOM_MORE {
|
||||
self.clip_zoom_factor = (aperture / P::aperture_start()).0;
|
||||
}
|
||||
|
||||
P::aperture_start()
|
||||
};
|
||||
|
||||
|
||||
@@ -70,6 +70,11 @@ fn num_subdivision<P: Projection>(cell: &HEALPixCell, delta_depth: u8, camera: &
|
||||
let skewed_factor = (center_to_vertex_dist - smallest_center_to_vertex_dist)
|
||||
/ (largest_center_to_vertex_dist - smallest_center_to_vertex_dist);
|
||||
|
||||
if is_too_large::<P>(cell, camera) || cell.is_on_pole() || skewed_factor > 0.25 {
|
||||
num_sub += 1;
|
||||
}
|
||||
|
||||
/*
|
||||
if skewed_factor > 0.25 {
|
||||
num_sub += 1;
|
||||
}
|
||||
@@ -77,6 +82,7 @@ fn num_subdivision<P: Projection>(cell: &HEALPixCell, delta_depth: u8, camera: &
|
||||
if is_too_large::<P>(cell, camera) || cell.is_on_pole() {
|
||||
num_sub += 1;
|
||||
}
|
||||
*/
|
||||
|
||||
num_sub
|
||||
}
|
||||
@@ -1229,8 +1235,6 @@ impl ImageSurveys {
|
||||
(survey.is_allsky() || survey.get_config().get_format() == ImageFormatType::RGB8U) && meta.opacity == 1.0
|
||||
});
|
||||
|
||||
|
||||
|
||||
if !not_render_transparency_font {
|
||||
let shader_font = get_fontcolor_shader(&self.gl, shaders).bind(&self.gl);
|
||||
shader_font
|
||||
|
||||
@@ -51,8 +51,7 @@ impl TileUVW {
|
||||
let u = ((idx_row_in_slice as f32) + ((idx_row_in_tex as f32) / nside)) / num_textures_by_side_slice_f32;
|
||||
let v = ((idx_col_in_slice as f32) + ((idx_col_in_tex as f32) / nside)) / num_textures_by_side_slice_f32;
|
||||
|
||||
|
||||
let ds = 1_f32 / (num_textures_by_side_slice_f32 * nside) - 1_f32 / (texture_slice_px as f32);
|
||||
let ds = 1_f32 / (num_textures_by_side_slice_f32 * nside);
|
||||
|
||||
let w = (texture_idx as f32) / (num_textures_by_slice as f32);
|
||||
TileUVW([
|
||||
|
||||
@@ -31,7 +31,7 @@ pub fn depth_from_pixels_on_screen<P: Projection>(camera: &CameraViewPort, num_p
|
||||
|
||||
let two_power_two_times_depth_pixel =
|
||||
std::f32::consts::PI / (3.0 * angle_per_pixel * angle_per_pixel);
|
||||
let depth_pixel = (two_power_two_times_depth_pixel.log2() / 2.0).floor() as u32;
|
||||
let depth_pixel = (two_power_two_times_depth_pixel.log2() / 2.0).ceil() as u32;
|
||||
|
||||
//let survey_max_depth = conf.get_max_depth();
|
||||
// The depth of the texture
|
||||
|
||||
@@ -79,7 +79,7 @@ export let View = (function() {
|
||||
this.mode = View.PAN;
|
||||
|
||||
this.minFOV = this.maxFOV = null; // by default, no restriction
|
||||
this.fov_limit = 1000.0;
|
||||
this.fovLimit = 1000.0;
|
||||
|
||||
this.healpixGrid = new HealpixGrid();
|
||||
this.then = Date.now();
|
||||
@@ -678,7 +678,7 @@ export let View = (function() {
|
||||
|
||||
// zoom
|
||||
const dist = Math.sqrt(Math.pow(e.originalEvent.touches[0].clientX - e.originalEvent.touches[1].clientX, 2) + Math.pow(e.originalEvent.touches[0].clientY - e.originalEvent.touches[1].clientY, 2));
|
||||
const fov = Math.min(Math.max(view.pinchZoomParameters.initialFov * view.pinchZoomParameters.initialDistance / dist, 0.00002777777), view.fov_limit);
|
||||
const fov = Math.min(Math.max(view.pinchZoomParameters.initialFov * view.pinchZoomParameters.initialDistance / dist, 0.00002777777), view.fovLimit);
|
||||
view.setZoom(fov);
|
||||
|
||||
return;
|
||||
@@ -1372,8 +1372,8 @@ export let View = (function() {
|
||||
}
|
||||
let new_fov = si / Math.pow(this.pinchZoomParameters.initialAccDelta, alpha);
|
||||
|
||||
if (new_fov > this.fov_limit) {
|
||||
new_fov = this.fov_limit;
|
||||
if (new_fov > this.fovLimit) {
|
||||
new_fov = this.fovLimit;
|
||||
//this.pinchZoomParameters.initialAccDelta = Math.pow(si / new_fov, 1.0/alpha);
|
||||
}
|
||||
if (new_fov < 0.00002777777) {
|
||||
@@ -1397,8 +1397,8 @@ export let View = (function() {
|
||||
|
||||
let new_fov = si / Math.pow(this.pinchZoomParameters.initialAccDelta, alpha);
|
||||
|
||||
if (new_fov > this.fov_limit) {
|
||||
new_fov = this.fov_limit;
|
||||
if (new_fov > this.fovLimit) {
|
||||
new_fov = this.fovLimit;
|
||||
//this.pinchZoomParameters.initialAccDelta = Math.pow(si / new_fov, 1.0/alpha);
|
||||
}
|
||||
if (new_fov < 0.00002777777) {
|
||||
|
||||
Reference in New Issue
Block a user