forked from 1b-agent/opencadstudio-upstream
Underlays are rasterised for the view's scale; DGN V7 strokes one pixel wide
A page shown small was drawn from its full-size raster and thin lines broke up into dots. Once a zoom settles on another quarter-octave step, PDF, DWF and DGN underlays are rasterised again near their size on screen (never above the full-size raster), frames are requested until that happens, and the adjusted-pixel memo is kept per raster size. V7 element weights no longer widen strokes, matching V8 models. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cb7860e50e
commit
1cbe89ef62
8 files changed
+108
-19
No files matched your search
@@ -75,6 +75,15 @@ pub fn rasterize_page_display(path: &str, page: &str) -> Option<Arc<PdfPage>> {
|
||||
rasterize_cached(path, page, RASTER_DPI, true)
|
||||
}
|
||||
|
||||
/// The display raster at a lower DPI for a page shown small on screen
|
||||
/// (never above the on-screen 150 DPI).
|
||||
pub fn rasterize_page_display_at(path: &str, page: &str, dpi: f32) -> Option<Arc<PdfPage>> {
|
||||
rasterize_cached(path, page, dpi.clamp(1.0, RASTER_DPI), true)
|
||||
}
|
||||
|
||||
/// The DPI of the full-size display raster.
|
||||
pub const DISPLAY_DPI: f32 = RASTER_DPI;
|
||||
|
||||
fn rasterize_cached(path: &str, page: &str, dpi: f32, transparent: bool) -> Option<Arc<PdfPage>> {
|
||||
let key = (path.to_string(), page.to_string(), dpi.to_bits(), transparent);
|
||||
if let Some(hit) = page_cache()
|
||||
@@ -228,7 +237,8 @@ pub fn adjusted_pixels(path: &str, page: &str, raster: &PdfPage, adjust: PageAdj
|
||||
if identity {
|
||||
return raster.pixels.clone();
|
||||
}
|
||||
let key = (path.to_string(), page.to_string(), adjust);
|
||||
// One entry per raster size: a page is rasterised again for the zoom.
|
||||
let key = (path.to_string(), format!("{page}@{}x{}", raster.width, raster.height), adjust);
|
||||
if let Some(hit) = adjusted_cache()
|
||||
.lock()
|
||||
.unwrap_or_else(|error| error.into_inner())
|
||||
|
||||
Reference in new issue
Block a user