Restructure project directories (#333)
`/client/web` -> `/frontend` `/client/cli` -> *delete for now* `/client/native` -> *delete for now* `/core/editor` -> `/editor` `/core/document` -> `/graphene` `/core/renderer` -> `/charcoal` `/core/proc-macro` -> `/proc-macros` *(now plural)*
|
|
@ -5,7 +5,7 @@ curl https://sh.rustup.rs -sSf | sh -s -- -y
|
|||
export PATH=$PATH:/opt/buildhome/.cargo/bin
|
||||
|
||||
echo 🚧 Install Node dependencies
|
||||
cd client/web
|
||||
cd frontend
|
||||
npm install
|
||||
|
||||
echo 👷 Build Graphite web client
|
||||
|
|
|
|||
|
|
@ -23,13 +23,13 @@ jobs:
|
|||
node-version: '14.x'
|
||||
|
||||
- name: 🚧 Install Node dependencies
|
||||
run: cd client/web && npm install
|
||||
run: cd frontend && npm install
|
||||
|
||||
- name: 🌐 Build Graphite web code
|
||||
run: cd client/web && npm run build
|
||||
run: cd frontend && npm run build
|
||||
|
||||
- name: 👕 Lint Graphite web formatting
|
||||
run: export NODE_ENV=production && cd client/web && npm run lint
|
||||
run: export NODE_ENV=production && cd frontend && npm run lint
|
||||
|
||||
- name: 🔬 Check Rust formatting
|
||||
run: cargo fmt --all -- --check
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@
|
|||
"html.format.wrapLineLength": 200,
|
||||
"eslint.format.enable": true,
|
||||
"eslint.workingDirectories": [
|
||||
"./client/web"
|
||||
"./frontend"
|
||||
],
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"typescript",
|
||||
],
|
||||
"vetur.format.enable": false,
|
||||
}
|
||||
}
|
||||
|
|
@ -85,7 +85,25 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "graphite-document-core"
|
||||
name = "graphite-charcoal"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "graphite-editor"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"env_logger",
|
||||
"glam",
|
||||
"graphite-graphene",
|
||||
"graphite-proc-macros",
|
||||
"log",
|
||||
"serde",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "graphite-graphene"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"glam",
|
||||
|
|
@ -94,41 +112,23 @@ dependencies = [
|
|||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "graphite-editor-core"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"env_logger",
|
||||
"glam",
|
||||
"graphite-document-core",
|
||||
"graphite-proc-macros",
|
||||
"log",
|
||||
"serde",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "graphite-proc-macros"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"graphite-editor-core",
|
||||
"graphite-editor",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "graphite-renderer-core"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "graphite-wasm-wrapper"
|
||||
name = "graphite-wasm"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"console_error_panic_hook",
|
||||
"graphite-document-core",
|
||||
"graphite-editor-core",
|
||||
"graphite-editor",
|
||||
"graphite-graphene",
|
||||
"log",
|
||||
"serde",
|
||||
"wasm-bindgen",
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
[workspace]
|
||||
members = [
|
||||
"core/*",
|
||||
"client/web/wasm",
|
||||
"editor",
|
||||
"graphene",
|
||||
"charcoal",
|
||||
"proc-macros",
|
||||
"frontend/wasm",
|
||||
]
|
||||
|
||||
[profile.release.package.graphite-wasm-wrapper]
|
||||
[profile.release.package.graphite-wasm]
|
||||
opt-level = "s"
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ Development is broken into monthly sprints culminating in a presentation at the
|
|||
|
||||
## Running the code
|
||||
|
||||
The project is split between clients and core libraries (which are used by the clients). Currently the only client is the web frontend (`/client/web`). The web client's Vue code lives in `/client/web/src` and a Rust translation layer for the editor core library lives in `/client/web/wasm`. A good starting point for learning about the code structure and architecture is reading the [documentation](docs/index.md).
|
||||
The project architecture is split between clients and core libraries (which are used by the clients). Currently the only client is the web frontend (`/frontend`). The web client's Vue code lives in `/frontend/src` and a Rust translation layer for the editor client backend lives in `/frontend/wasm`. A good starting point for learning about the code structure and architecture is reading the [documentation](docs/index.md).
|
||||
|
||||
To run the project while developing:
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
[package]
|
||||
name = "graphite-renderer-core"
|
||||
name = "graphite-charcoal"
|
||||
version = "0.1.0"
|
||||
authors = ["Graphite Authors <contact@graphite.design>"]
|
||||
edition = "2018"
|
||||
readme = "../../README.md"
|
||||
readme = "../README.md"
|
||||
homepage = "https://www.graphite.design"
|
||||
repository = "https://github.com/GraphiteEditor/Graphite"
|
||||
license = "Apache-2.0"
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn it_works() {
|
||||
assert_eq!(2 + 2, 4);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# CLI headless client
|
||||
|
||||
This will be the official command line program for editing and rendering Graphite documents and assets. It acts as a stateless tool for calling the APIs of the document core library and the render engine core library. This is useful for automation through shell scripts, for example, rather than needing to write custom software to use the Graphite core libraries. Because the Graphite CLI tool does not rely on the editor core library, there is no concept of tools or state.
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# Native editor client
|
||||
|
||||
This will be the official desktop and web client. While the Rust GUI ecosystem is relatively immature and the Graphite project does not have the resources to make a custom GUI system that nicely supports extensions, the web frontend is the temporary official editor client. The HTML-based frontend client will be replaced by the native client compiled to WASM and running in an HTML Canvas with the WebGPU browser graphics API.
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
//! Graphite Document Core Library: `/core/document/`
|
||||
//!
|
||||
//! A stateless library for updating Graphite design document (GDD) files.
|
||||
//! The official Graphite CLI and Editor Core Library are the primary users, but this library is intended to be useful
|
||||
//! to any application that wants to link the library for the purpose of updating GDD files by sending edit operations.
|
||||
//! Optionally depends on the Renderer Core Library if rendering is required.
|
||||
|
||||
pub mod color;
|
||||
pub mod document;
|
||||
pub mod intersection;
|
||||
pub mod layers;
|
||||
pub mod operation;
|
||||
pub mod response;
|
||||
|
||||
pub use intersection::Quad;
|
||||
pub use operation::Operation;
|
||||
pub use response::DocumentResponse;
|
||||
|
||||
pub type LayerId = u64;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub enum DocumentError {
|
||||
LayerNotFound,
|
||||
InvalidPath,
|
||||
IndexOutOfBounds,
|
||||
NotAFolder,
|
||||
NonReorderableSelection,
|
||||
NotAShape,
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
//! Graphite Renderer Core Library: `/core/renderer/`
|
||||
//!
|
||||
//! A stateless library (with the help of in-memory and/or on-disk caches for performance) for rendering Graphite's render graph (GRD) files.
|
||||
//! The official Graphite CLI and Document Core Library are the primary users,
|
||||
//! but this library is intended to be useful to any application that wants to link the library for the purpose of rendering Graphite's render graphs.
|
||||
//! For example, games can link the library and render procedural textures with customizable parametric input values.
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn it_works() {
|
||||
assert_eq!(2 + 2, 4);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
# Graphite codebase docs
|
||||
|
||||
This is a great place to start learning about the Graphite codebase and its architecture and code structure.
|
||||
|
||||
## Core libraries
|
||||
|
||||
Graphite's core rust codebase is split into three reusable libraries:
|
||||
|
||||
- Editor
|
||||
- Graphene
|
||||
- Charcoal
|
||||
|
||||
Each depends on its successor in the list. These are used internally but also intended for usage by third parties through Rust or linked by a project in C, C++, or another language.
|
||||
|
||||
## Code structure
|
||||
|
||||
The main modules of the project architecture are outlined below. Some parts describe future features and the directories don't exist yet. **Bold** modules are required for Graphite 0.1 which is purely an SVG editor.
|
||||
|
||||
- **Web frontend**: `/frontend/`
|
||||
Initial GUI for Graphite that will eventually be replaced by a native GUI implementation
|
||||
- **Vue web app**: `src/`
|
||||
Imports the WASM code and uses Vue props to customize and reuse most GUI components
|
||||
- **Rust WebAssembly translation layer**: `wasm/`
|
||||
Wraps the editor client backend and provides an API for the web app to use unburdened by Rust's complex data types that are not supported by JS
|
||||
- **Editor Client Backend**: `/editor/`
|
||||
Used by a frontend editor client to maintain GUI state and dispatch user events. The official Graphite editor is the primary user, but others software like game engines could embed their own customized editor implementations. Depends on Graphene.
|
||||
- **Graphene Document Graph Engine**: `/graphene/`
|
||||
A stateless library for updating Graphite design document (GDD) files. The official Graphite CLI and editor client backend are the primary users, but this library is intended to be useful to any application that wants to link the library for the purpose of updating GDD files by sending edit operations. Optionally depends on Charcoal if rendering is required.
|
||||
- **Charcoal Asset Render Engine**: `/charcoal/`
|
||||
A stateless library (with the help of in-memory and/or on-disk caches for performance) for rendering Graphite's render graph (GRD) files. The official Graphite CLI and Graphene are the primary users, but this library is intended to be useful to any application that wants to link the library for the purpose of rendering Graphite's render graphs. For example, games can link the library and render procedural textures with customizable parametric input values.
|
||||
|
||||
## Architecture diagram
|
||||
|
||||
Take this [Architecture Overview](architecture-overview.nomnoml) diagram and paste it into the [Nomnoml](https://nomnoml.com/) diagram editor. We'll set up a better way to render Nomnoml diagrams when we have a proper home for this documentation.
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
# Graphite codebase docs
|
||||
|
||||
This is a great place to start learning about the Graphite codebase and its architecture and code structure.
|
||||
|
||||
## Core libraries
|
||||
|
||||
Graphite's core rust codebase is split into three reusable libraries:
|
||||
|
||||
- Graphite Editor Core Library
|
||||
- Graphite Document Core Library
|
||||
- Graphite Renderer Core Library
|
||||
|
||||
Each depends on its successor in the list. These are used internally but also intended for usage by third parties through Rust or linked by a project in C, C++, or another language.
|
||||
|
||||
## Code structure
|
||||
|
||||
The main modules of the project architecture are outlined below. Some parts describe future features and the directories don't exist yet. **Bold** modules are required for Graphite 0.1 which is purely an SVG editor.
|
||||
|
||||
- **Web frontend**: `/client/web/`
|
||||
Initial GUI for Graphite that will eventually be replaced by a native GUI implementation
|
||||
- **Vue web app**: `src/`
|
||||
Imports the WASM code and uses Vue props to customize and reuse most GUI components
|
||||
- **Rust WebAssembly wrapper**: `wasm/`
|
||||
Wraps the Editor Core Library and provides an API for the web app to use unburdened by Rust's complex data types that are not supported by WASM
|
||||
- Native frontend: `/client/native/`
|
||||
The future official desktop client. Blocked on Rust's GUI ecosystem improving or dedicating the time to build a custom system that can nicely support editor extensions. The whole GUI should use WGPU for rendering and compile to WASM to make those calls to the WebGPU API.
|
||||
- CLI: `/client/cli/`
|
||||
A future headless, stateless, command line GDD document editor (using the Document Core Library) and GRD render graph renderer (using the Renderer Core Library).
|
||||
- **Graphite Editor Core Library**: `/core/editor/`
|
||||
Used by a frontend editor client to maintain GUI state and dispatch user events. The official Graphite editor is the primary user, but others software like game engines could embed their own customized editor implementations. Depends on the Document Core Library.
|
||||
- Graphite Document Core Library: `/core/document/`
|
||||
A stateless library for updating Graphite design document (GDD) files. The official Graphite CLI and Editor Core Library are the primary users, but this library is intended to be useful to any application that wants to link the library for the purpose of updating GDD files by sending edit operations. Optionally depends on the Renderer Core Library if rendering is required.
|
||||
- Graphite Renderer Core Library: `/core/renderer/`
|
||||
A stateless library (with the help of in-memory and/or on-disk caches for performance) for rendering Graphite's render graph (GRD) files. The official Graphite CLI and Document Core Library are the primary users, but this library is intended to be useful to any application that wants to link the library for the purpose of rendering Graphite's render graphs. For example, games can link the library and render procedural textures with customizable parametric input values.
|
||||
|
||||
## Architecture diagram
|
||||
|
||||
Take this [Architecture Overview](architecture-overview.nomnoml) diagram and paste it into the [Nomnoml](https://nomnoml.com/) diagram editor. We'll set up a better way to render Nomnoml diagrams when we have a proper home for this documentation.
|
||||
|
|
@ -57,7 +57,7 @@ Contributions welcome! If you think of something Graphite would be great for, su
|
|||
- Removing translucent watermarks that were applied in the same location to a batch of photos by finding their shared similarities and differences and using that as a subtraction diff
|
||||
|
||||
## Game development
|
||||
- Design a GUI for the game and use the Graphite Renderer Core Library to render the in-game GUI textures at runtime at the desired resolution without scaling problems, or even render it live as data updates its state
|
||||
- Design a GUI for the game and use Charcoal to render the in-game GUI textures at runtime at the desired resolution without scaling problems, or even render it live as data updates its state
|
||||
- Authoring procedural noise-based textures and PBR materials
|
||||
|
||||
## Data visualization
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ TODO: Add more to make a comprehensive list, finish writing definitions, separat
|
|||
- GDD file
|
||||
Graphite Design Document. A binary serialization of a *document* source file. The format includes a chain of *operations* that describe changes to the *layer graph* and the *properties* of *layers* throughout the history of the document since its creation. It also stores certain metadata and *embedded* file data. GDD files, along with *GRD files*, represent *assets* when shared. Because GDD files are editable (unlike *GRD files*), the *layers* of GDD *assets* may be expanded in the layer graph to reveal and modify their contents using a copy-on-write scheme stored to the *asset's* *layer*.
|
||||
- GRD file
|
||||
Graphite Render Data. A binary serialization of a *render graph* file. The format includes a single directed acyclic graph (DAG) compiled from the *layer graph* of a *document* as well as certain *properties* of set *data types* that are *imported* and *exported*. GRD files, along with *GDD files*, represent *assets* when shared. Because GRD files are read-only and can't be edited (unlike *GDD files*), the *layers* of GRD *assets* do not offer an ability to be expanded in the layer graph. GRD files are useful for sharing *assets* when their authors do not wish to provide the source *documents* used for their authoring. They are also the input format included in games that utilize the *Graphite Renderer Core Library* to render graphical content at runtime, as well as similar applications like headless renderers on web servers and image processing pipelines.
|
||||
Graphite Render Data. A binary serialization of a *render graph* file. The format includes a single directed acyclic graph (DAG) compiled from the *layer graph* of a *document* as well as certain *properties* of set *data types* that are *imported* and *exported*. GRD files, along with *GDD files*, represent *assets* when shared. Because GRD files are read-only and can't be edited (unlike *GDD files*), the *layers* of GRD *assets* do not offer an ability to be expanded in the layer graph. GRD files are useful for sharing *assets* when their authors do not wish to provide the source *documents* used for their authoring. They are also the input format included in games that utilize *Charcoal* to render graphical content at runtime, as well as similar applications like headless renderers on web servers and image processing pipelines.
|
||||
- Window
|
||||
- Main window
|
||||
- Popout window
|
||||
|
|
@ -63,9 +63,9 @@ TODO: Add more to make a comprehensive list, finish writing definitions, separat
|
|||
- Port
|
||||
- Connection
|
||||
- Core Libraries
|
||||
- Editor Core Library
|
||||
- Document Core Library
|
||||
- Renderer Core Library
|
||||
- Editor client backend
|
||||
- Graphene
|
||||
- Charcoal
|
||||
- Trace
|
||||
- Path
|
||||
- Shape
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
[package]
|
||||
name = "graphite-editor-core"
|
||||
name = "graphite-editor"
|
||||
version = "0.1.0"
|
||||
authors = ["Graphite Authors <contact@graphite.design>"]
|
||||
edition = "2018"
|
||||
readme = "../../README.md"
|
||||
readme = "../README.md"
|
||||
homepage = "https://www.graphite.design"
|
||||
repository = "https://github.com/GraphiteEditor/Graphite"
|
||||
license = "Apache-2.0"
|
||||
|
|
@ -13,12 +13,12 @@ log = "0.4"
|
|||
bitflags = "1.2.1"
|
||||
thiserror = "1.0.24"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
graphite-proc-macros = { path = "../proc-macro" }
|
||||
graphite-proc-macros = { path = "../proc-macros" }
|
||||
glam = { version="0.17", features = ["serde"] }
|
||||
|
||||
[dependencies.document-core]
|
||||
path = "../document"
|
||||
package = "graphite-document-core"
|
||||
[dependencies.graphene]
|
||||
path = "../graphene"
|
||||
package = "graphite-graphene"
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.8.4"
|
||||
|
|
@ -83,7 +83,7 @@ impl Dispatcher {
|
|||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::{document::DocumentMessageHandler, message_prelude::*, misc::test_utils::EditorTestUtils, Editor};
|
||||
use document_core::{color::Color, Operation};
|
||||
use graphene::{color::Color, Operation};
|
||||
use log::info;
|
||||
|
||||
fn init_logger() {
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
pub use super::layer_panel::*;
|
||||
use crate::{frontend::layer_panel::*, EditorError};
|
||||
use document_core::{document::Document as InternalDocument, LayerId};
|
||||
use glam::{DAffine2, DVec2};
|
||||
use graphene::{document::Document as InternalDocument, LayerId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::input::InputPreprocessor;
|
||||
use crate::message_prelude::*;
|
||||
use document_core::layers::BlendMode;
|
||||
use document_core::{DocumentResponse, Operation as DocumentOperation};
|
||||
use graphene::layers::BlendMode;
|
||||
use graphene::{DocumentResponse, Operation as DocumentOperation};
|
||||
use log::warn;
|
||||
|
||||
use std::collections::VecDeque;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
use crate::input::InputPreprocessor;
|
||||
use crate::message_prelude::*;
|
||||
use document_core::layers::Layer;
|
||||
use document_core::{LayerId, Operation as DocumentOperation};
|
||||
use graphene::layers::Layer;
|
||||
use graphene::{LayerId, Operation as DocumentOperation};
|
||||
use log::warn;
|
||||
|
||||
use std::collections::VecDeque;
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
use crate::{consts::ROTATE_SNAP_INTERVAL, frontend::layer_panel::*};
|
||||
use document_core::{
|
||||
use glam::{DAffine2, DVec2};
|
||||
use graphene::{
|
||||
layers::{Layer, LayerData as DocumentLayerData},
|
||||
LayerId,
|
||||
};
|
||||
use glam::{DAffine2, DVec2};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
|
||||
|
|
@ -7,9 +7,9 @@ use crate::{
|
|||
consts::{MOUSE_ZOOM_RATE, VIEWPORT_SCROLL_RATE, VIEWPORT_ZOOM_SCALE_MAX, VIEWPORT_ZOOM_SCALE_MIN, WHEEL_ZOOM_RATE},
|
||||
input::{mouse::ViewportPosition, InputPreprocessor},
|
||||
};
|
||||
use document_core::document::Document;
|
||||
use document_core::Operation as DocumentOperation;
|
||||
use glam::DVec2;
|
||||
use graphene::document::Document;
|
||||
use graphene::Operation as DocumentOperation;
|
||||
|
||||
use std::collections::VecDeque;
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
use crate::document::LayerData;
|
||||
use document_core::layers::{BlendMode, LayerDataType};
|
||||
use graphene::layers::{BlendMode, LayerDataType};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
|
||||
|
|
@ -11,7 +11,7 @@ pub struct LayerPanelEntry {
|
|||
pub opacity: f64,
|
||||
pub layer_type: LayerType,
|
||||
pub layer_data: LayerData,
|
||||
// TODO: instead of turning the u64 into (u32, u32)s here, do that in the wasm wrapper
|
||||
// TODO: Instead of turning the u64 into (u32, u32)s here, do that in the WASM translation layer
|
||||
pub path: Vec<(u32, u32)>,
|
||||
pub thumbnail: String,
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@ use crate::message_prelude::*;
|
|||
use bitflags::bitflags;
|
||||
|
||||
#[doc(inline)]
|
||||
pub use document_core::DocumentResponse;
|
||||
pub use graphene::DocumentResponse;
|
||||
|
||||
#[impl_message(Message, InputPreprocessor)]
|
||||
#[derive(PartialEq, Clone, Debug)]
|
||||
|
|
@ -75,7 +75,7 @@ impl MessageHandler<InputPreprocessorMessage, ()> for InputPreprocessor {
|
|||
}
|
||||
InputPreprocessorMessage::ViewportResize(size) => {
|
||||
responses.push_back(
|
||||
document_core::Operation::TransformLayer {
|
||||
graphene::Operation::TransformLayer {
|
||||
path: vec![],
|
||||
transform: glam::DAffine2::from_translation((size.as_f64() - self.viewport_size.as_f64()) / 2.).to_cols_array(),
|
||||
}
|
||||
|
|
@ -1,10 +1,3 @@
|
|||
//! **Graphite Editor Core Library**: `/core/editor/`
|
||||
//!
|
||||
//! Used by a frontend editor client to maintain GUI state and dispatch user events.
|
||||
//! The official Graphite editor is the primary user,
|
||||
//! but others software like game engines could embed their own customized editor implementations.
|
||||
//! Depends on the Document Core Library.
|
||||
|
||||
// since our policy is tabs, we want to stop clippy from warning about that
|
||||
#![allow(clippy::tabs_in_doc_comments)]
|
||||
|
||||
|
|
@ -25,13 +18,13 @@ pub mod consts;
|
|||
pub use misc::EditorError;
|
||||
|
||||
#[doc(inline)]
|
||||
pub use document_core::color::Color;
|
||||
pub use graphene::color::Color;
|
||||
|
||||
#[doc(inline)]
|
||||
pub use document_core::LayerId;
|
||||
pub use graphene::LayerId;
|
||||
|
||||
#[doc(inline)]
|
||||
pub use document_core::document::Document as SvgDocument;
|
||||
pub use graphene::document::Document as SvgDocument;
|
||||
|
||||
#[doc(inline)]
|
||||
pub use frontend::Callback;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
use crate::Color;
|
||||
use document_core::DocumentError;
|
||||
use graphene::DocumentError;
|
||||
use thiserror::Error;
|
||||
|
||||
/// The error type used by the Graphite editor.
|
||||
|
|
@ -7,7 +7,7 @@ use crate::{
|
|||
tool::ToolType,
|
||||
Editor,
|
||||
};
|
||||
use document_core::color::Color;
|
||||
use graphene::color::Color;
|
||||
|
||||
/// A set of utility functions to make the writing of editor test more declarative
|
||||
pub trait EditorTestUtils {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
use crate::message_prelude::*;
|
||||
use document_core::color::Color;
|
||||
use graphene::color::Color;
|
||||
|
||||
use crate::input::InputPreprocessor;
|
||||
use crate::{
|
||||
|
|
@ -2,8 +2,8 @@ use crate::input::keyboard::Key;
|
|||
use crate::input::InputPreprocessor;
|
||||
use crate::tool::{DocumentToolData, Fsm, ToolActionHandlerData};
|
||||
use crate::{document::DocumentMessageHandler, message_prelude::*};
|
||||
use document_core::{layers::style, Operation};
|
||||
use glam::DAffine2;
|
||||
use graphene::{layers::style, Operation};
|
||||
|
||||
use super::resize::*;
|
||||
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
use crate::consts::SELECTION_TOLERANCE;
|
||||
use crate::message_prelude::*;
|
||||
use crate::tool::{ToolActionHandlerData, ToolMessage};
|
||||
use document_core::layers::LayerDataType;
|
||||
use document_core::Quad;
|
||||
use glam::DVec2;
|
||||
use graphene::layers::LayerDataType;
|
||||
use graphene::Quad;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Eyedropper;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
use crate::consts::SELECTION_TOLERANCE;
|
||||
use crate::message_prelude::*;
|
||||
use crate::tool::ToolActionHandlerData;
|
||||
use document_core::{Operation, Quad};
|
||||
use glam::DVec2;
|
||||
use graphene::{Operation, Quad};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Fill;
|
||||
|
|
@ -5,8 +5,8 @@ use crate::input::keyboard::Key;
|
|||
use crate::input::{mouse::ViewportPosition, InputPreprocessor};
|
||||
use crate::tool::{DocumentToolData, Fsm, ToolActionHandlerData};
|
||||
use crate::{document::DocumentMessageHandler, message_prelude::*};
|
||||
use document_core::{layers::style, Operation};
|
||||
use glam::{DAffine2, DVec2};
|
||||
use graphene::{layers::style, Operation};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Line {
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
use crate::input::InputPreprocessor;
|
||||
use crate::tool::{DocumentToolData, Fsm, ToolActionHandlerData};
|
||||
use crate::{document::DocumentMessageHandler, message_prelude::*};
|
||||
use document_core::{layers::style, Operation};
|
||||
use glam::DAffine2;
|
||||
use graphene::{layers::style, Operation};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Pen {
|
||||
|
|
@ -2,8 +2,8 @@ use crate::input::keyboard::Key;
|
|||
use crate::input::InputPreprocessor;
|
||||
use crate::tool::{DocumentToolData, Fsm, ToolActionHandlerData};
|
||||
use crate::{document::DocumentMessageHandler, message_prelude::*};
|
||||
use document_core::{layers::style, Operation};
|
||||
use glam::DAffine2;
|
||||
use graphene::{layers::style, Operation};
|
||||
|
||||
use super::resize::*;
|
||||
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
use crate::input::keyboard::Key;
|
||||
use crate::input::{mouse::ViewportPosition, InputPreprocessor};
|
||||
use crate::message_prelude::*;
|
||||
use document_core::Operation;
|
||||
use glam::{DAffine2, Vec2Swizzles};
|
||||
use graphene::Operation;
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct Resize {
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
use document_core::color::Color;
|
||||
use document_core::layers::style;
|
||||
use document_core::layers::style::Fill;
|
||||
use document_core::layers::style::Stroke;
|
||||
use document_core::Operation;
|
||||
use document_core::Quad;
|
||||
use graphene::color::Color;
|
||||
use graphene::layers::style;
|
||||
use graphene::layers::style::Fill;
|
||||
use graphene::layers::style::Stroke;
|
||||
use graphene::Operation;
|
||||
use graphene::Quad;
|
||||
|
||||
use glam::{DAffine2, DVec2};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
|
@ -2,8 +2,8 @@ use crate::input::keyboard::Key;
|
|||
use crate::input::InputPreprocessor;
|
||||
use crate::tool::{DocumentToolData, Fsm, ShapeType, ToolActionHandlerData, ToolOptions, ToolType};
|
||||
use crate::{document::DocumentMessageHandler, message_prelude::*};
|
||||
use document_core::{layers::style, Operation};
|
||||
use glam::DAffine2;
|
||||
use graphene::{layers::style, Operation};
|
||||
|
||||
use super::resize::*;
|
||||
|
||||
|
Before Width: | Height: | Size: 147 B After Width: | Height: | Size: 147 B |
|
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 142 B |
|
Before Width: | Height: | Size: 122 B After Width: | Height: | Size: 122 B |
|
Before Width: | Height: | Size: 268 B After Width: | Height: | Size: 268 B |
|
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 260 B |
|
Before Width: | Height: | Size: 422 B After Width: | Height: | Size: 422 B |
|
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 402 B |
|
Before Width: | Height: | Size: 657 B After Width: | Height: | Size: 657 B |
|
Before Width: | Height: | Size: 378 B After Width: | Height: | Size: 378 B |
|
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 271 B |
|
Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 381 B |
|
Before Width: | Height: | Size: 132 B After Width: | Height: | Size: 132 B |
|
Before Width: | Height: | Size: 171 B After Width: | Height: | Size: 171 B |
|
Before Width: | Height: | Size: 353 B After Width: | Height: | Size: 353 B |
|
Before Width: | Height: | Size: 170 B After Width: | Height: | Size: 170 B |
|
Before Width: | Height: | Size: 114 B After Width: | Height: | Size: 114 B |
|
Before Width: | Height: | Size: 112 B After Width: | Height: | Size: 112 B |
|
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 138 B |
|
Before Width: | Height: | Size: 188 B After Width: | Height: | Size: 188 B |
|
Before Width: | Height: | Size: 193 B After Width: | Height: | Size: 193 B |
|
Before Width: | Height: | Size: 187 B After Width: | Height: | Size: 187 B |
|
Before Width: | Height: | Size: 188 B After Width: | Height: | Size: 188 B |
|
Before Width: | Height: | Size: 187 B After Width: | Height: | Size: 187 B |
|
Before Width: | Height: | Size: 193 B After Width: | Height: | Size: 193 B |
|
Before Width: | Height: | Size: 172 B After Width: | Height: | Size: 172 B |
|
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 150 B |
|
Before Width: | Height: | Size: 124 B After Width: | Height: | Size: 124 B |
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 130 B |
|
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 204 B |
|
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 216 B After Width: | Height: | Size: 216 B |
|
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 348 B After Width: | Height: | Size: 348 B |
|
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 349 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 309 B After Width: | Height: | Size: 309 B |