mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
New overlay system (#1516)
* Port gradient tool overlays * Fix tests * Text tool * Artboard tool and some of select tool * Port select tool drawing box * Pen and path tool * Remove overlays document * Show the overlay refactor as done on the website roadmap * Select tool bounds in layer space (first layer) * Code review and fixes --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
parent
9e06e70aa2
commit
c42d030f18
@@ -1,16 +1,16 @@
|
||||
mod quad;
|
||||
|
||||
use crate::raster::{BlendMode, Image, ImageFrame};
|
||||
use crate::uuid::{generate_uuid, ManipulatorGroupId};
|
||||
use crate::{vector::VectorData, Artboard, Color, GraphicElement, GraphicGroup};
|
||||
use base64::Engine;
|
||||
use bezier_rs::Subpath;
|
||||
|
||||
pub use quad::Quad;
|
||||
|
||||
use bezier_rs::Subpath;
|
||||
|
||||
use base64::Engine;
|
||||
use glam::{DAffine2, DVec2};
|
||||
use usvg::TreeParsing;
|
||||
|
||||
mod quad;
|
||||
|
||||
/// Represents a clickable target for the layer
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ClickTarget {
|
||||
@@ -83,7 +83,7 @@ impl SvgRender {
|
||||
self.svg.push("\t".repeat(self.indent));
|
||||
}
|
||||
|
||||
/// Add an outer `<svg />` tag with a `viewBox` and the `<defs />`
|
||||
/// Add an outer `<svg>...</svg>` tag with a `viewBox` and the `<defs />`
|
||||
pub fn format_svg(&mut self, bounds_min: DVec2, bounds_max: DVec2) {
|
||||
let (x, y) = bounds_min.into();
|
||||
let (size_x, size_y) = (bounds_max - bounds_min).into();
|
||||
@@ -93,7 +93,7 @@ impl SvgRender {
|
||||
self.svg.push("</svg>");
|
||||
}
|
||||
|
||||
/// Wraps the SVG with `<svg><g transform="...">`, which allows for rotation
|
||||
/// Wraps the SVG with `<svg><g transform="...">...</g></svg>`, which allows for rotation
|
||||
pub fn wrap_with_transform(&mut self, transform: DAffine2, size: Option<DVec2>) {
|
||||
let defs = &self.svg_defs;
|
||||
let view_box = size
|
||||
|
||||
@@ -2,7 +2,7 @@ use glam::{DAffine2, DVec2};
|
||||
|
||||
#[derive(Debug, Clone, Default, Copy)]
|
||||
/// A quad defined by four vertices.
|
||||
pub struct Quad([DVec2; 4]);
|
||||
pub struct Quad(pub [DVec2; 4]);
|
||||
|
||||
impl Quad {
|
||||
/// Create a zero sized quad at the point
|
||||
|
||||
Reference in New Issue
Block a user