mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
Desktop: Viewport bounds from viewport container (#2989)
* Remove build script because it created more issues that it solved * Get viewport bounds from viewport container
This commit is contained in:
3
desktop/.gitignore
vendored
3
desktop/.gitignore
vendored
@@ -1,3 +0,0 @@
|
||||
# Generated by Cargo
|
||||
# will have compiled files and executables
|
||||
/target/
|
||||
@@ -1,10 +0,0 @@
|
||||
use std::fs::metadata;
|
||||
|
||||
fn main() {
|
||||
let frontend_dir = format!("{}/../frontend/dist", env!("CARGO_MANIFEST_DIR"));
|
||||
metadata(&frontend_dir).expect("Failed to find frontend directory. Please build the frontend first.");
|
||||
metadata(format!("{}/index.html", &frontend_dir)).expect("Failed to find index.html in frontend directory.");
|
||||
|
||||
println!("cargo:rerun-if-changed=.");
|
||||
println!("cargo:rerun-if-changed=../frontend/dist");
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type Editor } from "@graphite/editor";
|
||||
|
||||
export function updateBoundsOfViewports(editor: Editor, container: HTMLElement) {
|
||||
const viewports = Array.from(container.querySelectorAll("[data-viewport]"));
|
||||
const viewports = Array.from(container.querySelectorAll("[data-viewport-container]"));
|
||||
const boundsOfViewports = viewports.map((canvas) => {
|
||||
const bounds = canvas.getBoundingClientRect();
|
||||
return [bounds.left, bounds.top, bounds.right, bounds.bottom];
|
||||
|
||||
Reference in New Issue
Block a user