mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-25 17:38:12 +08:00
Replace the image layer type with an Image node (#948)
* Use builder pattern for widgets * Arguments to new function * Add node graph when dragging in image * Fix duplicate import * Skip processing under node graph frame if unused * Reduce node graph rerenders * DUPLICATE ALL frontend changes into other frontend * DUPLICATE more changes to another frontend * Code review * Allow importing SVG files as bitmaps Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Keavon Chambers
parent
66e8325362
commit
64e62699fc
@@ -3,7 +3,7 @@ import { reactive, readonly } from "vue";
|
||||
|
||||
import { downloadFileText, downloadFileBlob, upload } from "@/utility-functions/files";
|
||||
import { imaginateGenerate, imaginateCheckConnection, imaginateTerminate, updateBackendImage } from "@/utility-functions/imaginate";
|
||||
import { rasterizeSVG, rasterizeSVGCanvas } from "@/utility-functions/rasterization";
|
||||
import { extractPixelData, rasterizeSVG, rasterizeSVGCanvas } from "@/utility-functions/rasterization";
|
||||
import { type Editor } from "@/wasm-communication/editor";
|
||||
import {
|
||||
type FrontendDocumentDetails,
|
||||
@@ -45,7 +45,8 @@ export function createPortfolioState(editor: Editor) {
|
||||
});
|
||||
editor.subscriptions.subscribeJsMessage(TriggerImport, async () => {
|
||||
const data = await upload("image/*", "data");
|
||||
editor.instance.pasteImage(data.type, Uint8Array.from(data.content));
|
||||
const imageData = await extractPixelData(new Blob([data.content], { type: data.type }));
|
||||
editor.instance.pasteImage(new Uint8Array(imageData.data), imageData.width, imageData.height);
|
||||
});
|
||||
editor.subscriptions.subscribeJsMessage(TriggerFileDownload, (triggerFileDownload) => {
|
||||
downloadFileText(triggerFileDownload.name, triggerFileDownload.document);
|
||||
|
||||
Reference in New Issue
Block a user