mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-26 03:18:11 +08:00
Break apart and improve the JS for rasterizing SVGs and downloading files (#786)
It now uses a blob URL instead of a data URL in the download process, which is cleaner and better performance.
This commit is contained in:
@@ -314,7 +314,7 @@ impl MessageHandler<DocumentMessage, (&InputPreprocessorMessageHandler, &FontCac
|
||||
self.graphene_document.root.transform = DAffine2::IDENTITY;
|
||||
GrapheneDocument::mark_children_as_dirty(&mut self.graphene_document.root);
|
||||
|
||||
// Calculates the bounding box of the region to be exported
|
||||
// Calculate the bounding box of the region to be exported
|
||||
use crate::messages::frontend::utility_types::ExportBounds;
|
||||
let bbox = match bounds {
|
||||
ExportBounds::AllArtwork => self.all_layer_bounds(font_cache),
|
||||
@@ -345,7 +345,7 @@ impl MessageHandler<DocumentMessage, (&InputPreprocessorMessageHandler, &FontCac
|
||||
} else {
|
||||
let mime = file_type.to_mime().to_string();
|
||||
let size = (size * scale_factor).into();
|
||||
responses.push_back(FrontendMessage::TriggerRasterDownload { document, name, mime, size }.into());
|
||||
responses.push_back(FrontendMessage::TriggerRasterDownload { svg: document, name, mime, size }.into());
|
||||
}
|
||||
}
|
||||
FlipSelectedLayers { flip_axis } => {
|
||||
|
||||
Reference in New Issue
Block a user