before_code stringlengths 30 149k | reviewer_comment stringlengths 16 20.6k | after_code stringlengths 30 163k | diff_context stringlengths 0 22.4k | file_path stringlengths 6 155 | comment_line int64 0 26 | language stringclasses 19
values | quality_score float64 0.07 1 | comment_type stringclasses 9
values | comment_length int64 16 20.6k | before_lines int64 2 4.61k | after_lines int64 2 4.4k | is_negative bool 2
classes | pr_title stringlengths 7 140 | pr_number int64 18 61.2k | repo_name stringclasses 29
values | repo_stars int64 321 56k | repo_language stringclasses 14
values | reviewer_username stringclasses 378
values | author_username stringclasses 739
values | user stringlengths 361 200k | assistant stringlengths 16 20.6k | system stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
builder.close()
}
}
let path = builder.finish().unwrap();
let mut path = usvg::Path::new(path.into());
path.transform = transform;
// TODO: use proper style
path.fill = None;
path.stroke = Some(usvg::Stroke::default());
usvg::Node::new(usvg::NodeKind::Path(path))
}
}
impl GraphicElementRendered... | No issues found. | builder.close()
}
}
let path = builder.finish().unwrap();
let mut path = usvg::Path::new(path.into());
path.transform = transform;
// TODO: use proper style
path.fill = None;
path.stroke = Some(usvg::Stroke::default());
usvg::Node::new(usvg::NodeKind::Path(path))
}
}
impl GraphicElementRendered... | @@ -227,6 +227,10 @@ pub trait GraphicElementRendered {
root: root_node.clone(),
}
}
+
+ fn contains_artboard(&self) -> bool {
+ false
+ }
}
impl GraphicElementRendered for GraphicGroup {
@@ -265,6 +269,10 @@ impl GraphicElementRendered for GraphicGroup {
}
root_node
}
+
+ fn contains_artboard(&se... | node-graph/gcore/src/graphic_element/renderer.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Fixes for removing artboards; white infinite canvas background | 1,497 | GraphiteEditor/Graphite | 17,935 | Rust | 0HyperCube | Review this pull request change.
Language: Rust
File: node-graph/gcore/src/graphic_element/renderer.rs
PR Title: Fixes for removing artboards; white infinite canvas background
BEFORE CODE: builder.close()
}
}
let path = builder.finish().unwrap();
let mut path = usvg::Path::new(path.into());
path.tran... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
#[node_macro::node_fn(RepeatNode)]
fn repeat_vector_data(mut vector_data: VectorData, direction: DVec2, count: u32) -> VectorData {
// repeat the vector data
let VectorData { subpaths, transform, .. } = &vector_data;
let mut new_subpaths: Vec<Subpath<_>> = Vec::with_capacity(subpaths.len() * count as usize);
let ... | No issues found. |
#[node_macro::node_fn(RepeatNode)]
fn repeat_vector_data(mut vector_data: VectorData, direction: DVec2, count: u32) -> VectorData {
// repeat the vector data
let VectorData { subpaths, transform, .. } = &vector_data;
let mut new_subpaths: Vec<Subpath<_>> = Vec::with_capacity(subpaths.len() * count as usize);
let ... | @@ -110,23 +110,18 @@ pub struct CircularRepeatNode<AngleOffset, Radius, Count> {
#[node_macro::node_fn(CircularRepeatNode)]
fn circular_repeat_vector_data(mut vector_data: VectorData, angle_offset: f32, radius: f32, count: u32) -> VectorData {
- // repeat the vector data
- let VectorData { subpaths, transform, .. ... | node-graph/gcore/src/vector/vector_nodes.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | New node: Copy to Points | 1,513 | GraphiteEditor/Graphite | 17,935 | Rust | Keavon | Review this pull request change.
Language: Rust
File: node-graph/gcore/src/vector/vector_nodes.rs
PR Title: New node: Copy to Points
BEFORE CODE:
#[node_macro::node_fn(RepeatNode)]
fn repeat_vector_data(mut vector_data: VectorData, direction: DVec2, count: u32) -> VectorData {
// repeat the vector data
let Vecto... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
DocumentMessage::UpdateClipTargets { clip_targets } => {
self.network_interface.update_clip_targets(clip_targets);
}
DocumentMessage::UpdateVectorModify { vector_modify } => {
self.network_interface.update_vector_modify(vector_modify);
}
DocumentMessage::Undo => {
if self.network_interface.tr... | No issues found. | DocumentMessage::UpdateClipTargets { clip_targets } => {
self.network_interface.update_clip_targets(clip_targets);
}
DocumentMessage::UpdateVectorModify { vector_modify } => {
self.network_interface.update_vector_modify(vector_modify);
}
DocumentMessage::Undo => {
if self.network_interface.tr... | @@ -1655,8 +1655,7 @@ impl DocumentMessageHandler {
/// Finds the artboard that bounds the point in viewport space and be the container of any newly added layers.
pub fn new_layer_bounding_artboard(&self, ipp: &InputPreprocessorMessageHandler) -> LayerNodeIdentifier {
self.click_xray(ipp)
- .filter(|layer| sel... | editor/src/messages/portfolio/document/document_message_handler.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Make Path tool deselect all points on single-click, and select all on double-click, of shape's fill | 2,148 | GraphiteEditor/Graphite | 17,935 | Rust | 0SlowPoke0 | Review this pull request change.
Language: Rust
File: editor/src/messages/portfolio/document/document_message_handler.rs
PR Title: Make Path tool deselect all points on single-click, and select all on double-click, of shape's fill
BEFORE CODE: DocumentMessage::UpdateClipTargets { clip_targets } => {
self.net... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
.tooltip(zoom_with_scroll_tooltip)
.on_update(|checkbox_input: &CheckboxInput| {
PreferencesMessage::ModifyLayout {
zoom_with_scroll: checkbox_input.checked,
}
.into()
})
.widget_holder(),
TextLabel::new("Zoom with Scroll").table_align(true).tooltip(zoom_with_scroll_tooltip).widg... | No issues found. | .tooltip(zoom_with_scroll_tooltip)
.on_update(|checkbox_input: &CheckboxInput| {
PreferencesMessage::ModifyLayout {
zoom_with_scroll: checkbox_input.checked,
}
.into()
})
.widget_holder(),
TextLabel::new("Zoom with Scroll").table_align(true).tooltip(zoom_with_scroll_tooltip).widg... | @@ -1,4 +1,5 @@
use crate::messages::layout::utility_types::widget_prelude::*;
+use crate::messages::preferences::SelectionMode;
use crate::messages::prelude::*;
pub struct PreferencesDialogMessageData<'a> {
@@ -31,6 +32,39 @@ impl PreferencesDialogMessageHandler {
const TITLE: &'static str = "Editor Preferences... | editor/src/messages/dialog/preferences_dialog/preferences_dialog_message_handler.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add an editor preference for touched/enclosed/directional based selection | 2,156 | GraphiteEditor/Graphite | 17,935 | Rust | pratikagr | Review this pull request change.
Language: Rust
File: editor/src/messages/dialog/preferences_dialog/preferences_dialog_message_handler.rs
PR Title: Add an editor preference for touched/enclosed/directional based selection
BEFORE CODE: .tooltip(zoom_with_scroll_tooltip)
.on_update(|checkbox_input: &CheckboxI... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
.bounding_box_manager
.as_ref()
.map(|bounding_box_manager| bounding_box_manager.transform_tampered)
.unwrap_or(true);
let state =
// Dragging the pivot
if is_over_pivot {
responses.add(DocumentMessage::StartTransaction);
// tool_data.snap_manager.start_snap(document, input, ... | No issues found. | .bounding_box_manager
.as_ref()
.map(|bounding_box_manager| bounding_box_manager.transform_tampered)
.unwrap_or(true);
let state =
// Dragging the pivot
if is_over_pivot {
responses.add(DocumentMessage::StartTransaction);
// tool_data.snap_manager.start_snap(document, input, ... | @@ -15,17 +15,17 @@ use crate::messages::portfolio::document::utility_types::nodes::SelectedNodes;
use crate::messages::portfolio::document::utility_types::transformation::Selected;
use crate::messages::preferences::SelectionMode;
use crate::messages::tool::common_functionality::compass_rose::{Axis, CompassRose};
-u... | editor/src/messages/tool/tool_messages/select_tool.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add sizing gizmos to the Text tool's text area | 2,176 | GraphiteEditor/Graphite | 17,935 | Rust | Nitish-bot | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/tool_messages/select_tool.rs
PR Title: Add sizing gizmos to the Text tool's text area
BEFORE CODE: .bounding_box_manager
.as_ref()
.map(|bounding_box_manager| bounding_box_manager.transform_tampered)
.unwrap_or(true);... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
type ToolData = LineToolData;
type ToolOptions = LineOptions;
fn transition(self, event: ToolMessage, tool_data: &mut Self::ToolData, tool_action_data: &mut ToolActionHandlerData, tool_options: &Self::ToolOptions, responses: &mut VecDeque<Message>) -> Self {
let ToolActionHandlerData {
document, global_tool_da... | No issues found. | type ToolData = LineToolData;
type ToolOptions = LineOptions;
fn transition(self, event: ToolMessage, tool_data: &mut Self::ToolData, tool_action_data: &mut ToolActionHandlerData, tool_options: &Self::ToolOptions, responses: &mut VecDeque<Message>) -> Self {
let ToolActionHandlerData {
document, global_tool_da... | @@ -293,18 +293,21 @@ fn generate_transform(tool_data: &mut LineToolData, snap_data: SnapData, lock_an
let mut angle = -(document_points[1] - document_points[0]).angle_to(DVec2::X);
let mut line_length = (document_points[1] - document_points[0]).length();
+
if lock_angle {
angle = tool_data.angle;
- }
- if s... | editor/src/messages/tool/tool_messages/line_tool.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | In Path tool when dragging a handle, make Alt recover the opposing handle if it's not cubic rather than zero-length | 2,196 | GraphiteEditor/Graphite | 17,935 | Rust | bakayu | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/tool_messages/line_tool.rs
PR Title: In Path tool when dragging a handle, make Alt recover the opposing handle if it's not cubic rather than zero-length
BEFORE CODE: type ToolData = LineToolData;
type ToolOptions = LineOptions;
fn tr... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
for (&layer, state) in &self.selected_shape_state {
let Some(vector_data) = document.network_interface.compute_modified_vector(layer) else { continue };
let opposing_handles = handle_lengths.as_ref().and_then(|handle_lengths| handle_lengths.get(&layer));
let transform_to_viewport_space = document.metadata(... | No issues found. | for (&layer, state) in &self.selected_shape_state {
let Some(vector_data) = document.network_interface.compute_modified_vector(layer) else { continue };
let opposing_handles = handle_lengths.as_ref().and_then(|handle_lengths| handle_lengths.get(&layer));
let transform_to_viewport_space = document.metadata(... | @@ -116,6 +116,20 @@ impl ClosestSegment {
(stroke_width_sq + tolerance_sq) < dist_sq
}
+ pub fn handle_positions(&self, document_metadata: &DocumentMetadata) -> (Option<DVec2>, Option<DVec2>) {
+ // Transform to viewport space
+ let transform = document_metadata.transform_to_viewport(self.layer);
+
+ // Spli... | editor/src/messages/tool/common_functionality/shape_editor.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add handle visualization during point insertion in the Path tool | 2,197 | GraphiteEditor/Graphite | 17,935 | Rust | 0SlowPoke0 | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/common_functionality/shape_editor.rs
PR Title: Add handle visualization during point insertion in the Path tool
BEFORE CODE: for (&layer, state) in &self.selected_shape_state {
let Some(vector_data) = document.network_interface.comp... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
use crate::messages::portfolio::document::utility_types::document_metadata::LayerNodeIdentifier;
use crate::messages::prelude::*;
use graphene_std::vector::PointId;
use glam::DVec2;
/// Determines if a path should be extended. Goal in viewport space. Returns the path and if it is extending from the start, if applica... | No issues found. | use crate::messages::portfolio::document::utility_types::document_metadata::LayerNodeIdentifier;
use crate::messages::prelude::*;
use graphene_std::vector::PointId;
use glam::DVec2;
/// Determines if a path should be extended. Goal in viewport space. Returns the path and if it is extending from the start, if applica... | @@ -7,14 +7,32 @@ use glam::DVec2;
/// Determines if a path should be extended. Goal in viewport space. Returns the path and if it is extending from the start, if applicable.
pub fn should_extend(document: &DocumentMessageHandler, goal: DVec2, tolerance: f64, layers: impl Iterator<Item = LayerNodeIdentifier>) -> Op... | editor/src/messages/tool/common_functionality/utility_functions.rs | 0 | Rust | 1 | none | 16 | 49 | 49 | true | Implement extending, joining, and creating new subpaths with the Spline tool | 2,203 | GraphiteEditor/Graphite | 17,935 | Rust | indierusty | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/common_functionality/utility_functions.rs
PR Title: Implement extending, joining, and creating new subpaths with the Spline tool
BEFORE CODE: use crate::messages::portfolio::document::utility_types::document_metadata::LayerNodeIdentifier... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
document.metadata().document_to_viewport.transform_vector2(snap_result.snapped_point_document - handle_position)
}
#[allow(clippy::too_many_arguments)]
fn drag(
&mut self,
equidistant: bool,
lock_angle: bool,
snap_angle: bool,
shape_editor: &mut ShapeState,
document: &DocumentMessageHandler,
input:... | No issues found. |
document.metadata().document_to_viewport.transform_vector2(snap_result.snapped_point_document - handle_position)
}
#[allow(clippy::too_many_arguments)]
fn drag(
&mut self,
equidistant: bool,
lock_angle: bool,
snap_angle: bool,
shape_editor: &mut ShapeState,
document: &DocumentMessageHandler,
input:... | @@ -1185,16 +1185,9 @@ impl Fsm for PathToolFsmState {
.push(HintGroup(vec![HintInfo::mouse(MouseMotion::Rmb, ""), HintInfo::keys([Key::Escape], "Cancel").prepend_slash()]));
let drag_anchor = HintInfo::keys([Key::Space], "Drag Anchor");
- let point_select_state_hint_group = match dragging_state.point_s... | editor/src/messages/tool/tool_messages/path_tool.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Improve the Pen tool's colinearity and equidistance controls | 2,242 | GraphiteEditor/Graphite | 17,935 | Rust | 0SlowPoke0 | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/tool_messages/path_tool.rs
PR Title: Improve the Pen tool's colinearity and equidistance controls
BEFORE CODE:
document.metadata().document_to_viewport.transform_vector2(snap_result.snapped_point_document - handle_position)
}
#[all... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
impl AsI64 for u64 {
fn as_i64(&self) -> i64 {
*self as i64
}
}
impl AsI64 for f64 {
fn as_i64(&self) -> i64 {
*self as i64
}
}
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize, Hash, DynAny, specta::Type, node_macro::ChoiceType)]
#[widget(Radio)]
pub enum GridType {
... | No issues found. | }
impl AsI64 for u64 {
fn as_i64(&self) -> i64 {
*self as i64
}
}
impl AsI64 for f64 {
fn as_i64(&self) -> i64 {
*self as i64
}
}
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize, Hash, DynAny, specta::Type, node_macro::ChoiceType)]
#[widget(Radio)]
pub enum GridType {
... | @@ -1,6 +1,7 @@
+use bezier_rs::BezierHandles;
use dyn_any::DynAny;
use glam::DVec2;
-use kurbo::Point;
+use kurbo::{CubicBez, Line, PathSeg, Point, QuadBez};
/// Represents different ways of calculating the centroid.
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize, Hash,... | node-graph/gcore/src/vector/misc.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Fix the Bevel node so it applies a consistent bevel size regardless of angle | 2,293 | GraphiteEditor/Graphite | 17,935 | Rust | MohdMohsin97 | Review this pull request change.
Language: Rust
File: node-graph/gcore/src/vector/misc.rs
PR Title: Fix the Bevel node so it applies a consistent bevel size regardless of angle
BEFORE CODE: }
impl AsI64 for u64 {
fn as_i64(&self) -> i64 {
*self as i64
}
}
impl AsI64 for f64 {
fn as_i64(&self) -> i64 {
*self ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
}
// Group connected segments to collapse them into a single point
// TODO: there are a few possible algorithms for this - perhaps test empirically to find fastest
let collapse: Vec<FxHashSet<PointId>> = petgraph::algo::tarjan_scc(&short_edges).into_iter().map(|connected| connected.into_iter().collect()).... | No issues found. | }
}
// Group connected segments to collapse them into a single point
// TODO: there are a few possible algorithms for this - perhaps test empirically to find fastest
let collapse: Vec<FxHashSet<PointId>> = petgraph::algo::tarjan_scc(&short_edges).into_iter().map(|connected| connected.into_iter().collect()).... | @@ -0,0 +1,95 @@
+use crate::vector::{PointId, VectorData, VectorDataIndex};
+use glam::DVec2;
+use petgraph::prelude::UnGraphMap;
+use rustc_hash::FxHashSet;
+
+impl VectorData {
+ /// Collapse all points with edges shorter than the specified distance
+ pub(crate) fn merge_by_distance(&mut self, distance: f64) {
+ //... | node-graph/gcore/src/vector/algorithms/merge_by_distance.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | New node: Merge by Distance | 2,307 | GraphiteEditor/Graphite | 17,935 | Rust | richard-uk1 | Review this pull request change.
Language: Rust
File: node-graph/gcore/src/vector/algorithms/merge_by_distance.rs
PR Title: New node: Merge by Distance
BEFORE CODE: }
}
// Group connected segments to collapse them into a single point
// TODO: there are a few possible algorithms for this - perhaps test emp... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
edges.2.then(|| (cursor - DVec2::new(min.x, cursor.y)).length_squared()),
edges.3.then(|| (cursor - DVec2::new(max.x, cursor.y)).length_squared()),
];
let min_distance = distances.iter().filter_map(|&x| x).min_by(|a, b| a.partial_cmp(b).unwrap());
match min_distance {
Some(min) => (
edges.0 && dist... | No issues found. | edges.2.then(|| (cursor - DVec2::new(min.x, cursor.y)).length_squared()),
edges.3.then(|| (cursor - DVec2::new(max.x, cursor.y)).length_squared()),
];
let min_distance = distances.iter().filter_map(|&x| x).min_by(|a, b| a.partial_cmp(b).unwrap());
match min_distance {
Some(min) => (
edges.0 && dist... | @@ -254,40 +254,36 @@ impl SelectedEdges {
(DAffine2::from_scale(enlargement_factor), pivot)
}
- // TODO: Add free movement when Ctrl is pressed to allow dragging the whole edge, not just sliding it
- pub fn skew_transform(&self, mouse: DVec2, to_viewport_transform: DAffine2, _free_movement: bool) -> DAffine2 {
... | editor/src/messages/tool/common_functionality/transformation_cage.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Enable free movement of transform cage edge during skew when Ctrl is held | 2,358 | GraphiteEditor/Graphite | 17,935 | Rust | mTvare6 | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/common_functionality/transformation_cage.rs
PR Title: Enable free movement of transform cage edge during skew when Ctrl is held
BEFORE CODE: edges.2.then(|| (cursor - DVec2::new(min.x, cursor.y)).length_squared()),
edges.3.then(|| ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
pub fn intersect_quad<'a>(&'a self, viewport_quad: graphene_core::renderer::Quad, ipp: &InputPreprocessorMessageHandler) -> impl Iterator<Item = LayerNodeIdentifier> + use<'a> {
let document_to_viewport = self.navigation_handler.calculate_offset_transform(ipp.viewport_bounds.center(), &self.document_ptz);
let docu... | No issues found. | pub fn intersect_quad<'a>(&'a self, viewport_quad: graphene_core::renderer::Quad, ipp: &InputPreprocessorMessageHandler) -> impl Iterator<Item = LayerNodeIdentifier> + use<'a> {
let document_to_viewport = self.navigation_handler.calculate_offset_transform(ipp.viewport_bounds.center(), &self.document_ptz);
let docu... | @@ -359,13 +359,29 @@ impl MessageHandler<DocumentMessage, DocumentMessageData<'_>> for DocumentMessag
continue;
}
let Some(bounds) = self.metadata().bounding_box_document(layer) else { continue };
+ let min = bounds[0].min(bounds[1]);
+ let max = bounds[0].max(bounds[1]);
let name = ... | editor/src/messages/portfolio/document/document_message_handler.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add PTZ support for flipping the canvas | 2,394 | GraphiteEditor/Graphite | 17,935 | Rust | Sidharth-Singh10 | Review this pull request change.
Language: Rust
File: editor/src/messages/portfolio/document/document_message_handler.rs
PR Title: Add PTZ support for flipping the canvas
BEFORE CODE: pub fn intersect_quad<'a>(&'a self, viewport_quad: graphene_core::renderer::Quad, ipp: &InputPreprocessorMessageHandler) -> impl It... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
Ready,
// Implemented as a fake dragging state that can be used to abort unwanted fills
Filling,
}
impl Fsm for FillToolFsmState {
type ToolData = ();
type ToolOptions = ();
fn transition(self, event: ToolMessage, _tool_data: &mut Self::ToolData, handler_data: &mut ToolActionHandlerData, _tool_options: &Self::T... | No issues found. | Ready,
// Implemented as a fake dragging state that can be used to abort unwanted fills
Filling,
}
impl Fsm for FillToolFsmState {
type ToolData = ();
type ToolOptions = ();
fn transition(self, event: ToolMessage, _tool_data: &mut Self::ToolData, handler_data: &mut ToolActionHandlerData, _tool_options: &Self::T... | @@ -1,7 +1,6 @@
use super::tool_prelude::*;
-
+use crate::messages::tool::common_functionality::graph_modification_utils::NodeGraphLayer;
use graphene_core::vector::style::Fill;
-
#[derive(Default)]
pub struct FillTool {
fsm_state: FillToolFsmState,
@@ -87,6 +86,10 @@ impl Fsm for FillToolFsmState {
let Some... | editor/src/messages/tool/tool_messages/fill_tool.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Fix fill tool on raster image temporarily breaks the graph | 2,398 | GraphiteEditor/Graphite | 17,935 | Rust | EllenGYY | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/tool_messages/fill_tool.rs
PR Title: Fix fill tool on raster image temporarily breaks the graph
BEFORE CODE: Ready,
// Implemented as a fake dragging state that can be used to abort unwanted fills
Filling,
}
impl Fsm for FillToolFsmS... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
NavigationMessage::CanvasZoomSet { zoom_factor } => {
let document_bounds = if !graph_view_overlay_open {
// TODO: Cache this in node graph coordinates and apply the transform to the rectangle to get viewport coordinates
network_interface.document_metadata().document_bounds_viewport_space()
} else ... | No issues found. | NavigationMessage::CanvasZoomSet { zoom_factor } => {
let document_bounds = if !graph_view_overlay_open {
// TODO: Cache this in node graph coordinates and apply the transform to the rectangle to get viewport coordinates
network_interface.document_metadata().document_bounds_viewport_space()
} else ... | @@ -1,6 +1,6 @@
use crate::consts::{
VIEWPORT_ROTATE_SNAP_INTERVAL, VIEWPORT_SCROLL_RATE, VIEWPORT_ZOOM_LEVELS, VIEWPORT_ZOOM_MIN_FRACTION_COVER, VIEWPORT_ZOOM_MOUSE_RATE, VIEWPORT_ZOOM_SCALE_MAX, VIEWPORT_ZOOM_SCALE_MIN,
- VIEWPORT_ZOOM_TO_FIT_PADDING_SCALE_FACTOR, VIEWPORT_ZOOM_WHEEL_RATE,
+ VIEWPORT_ZOOM_TO_FIT_P... | editor/src/messages/portfolio/document/navigation/navigation_message_handler.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add option to adjust viewport zoom rate in the preferences dialog | 2,420 | GraphiteEditor/Graphite | 17,935 | Rust | Sidharth-Singh10 | Review this pull request change.
Language: Rust
File: editor/src/messages/portfolio/document/navigation/navigation_message_handler.rs
PR Title: Add option to adjust viewport zoom rate in the preferences dialog
BEFORE CODE: NavigationMessage::CanvasZoomSet { zoom_factor } => {
let document_bounds = if !graph... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
NodeGraphMessage::ReorderImport { start_index, end_index } => {
network_interface.reorder_import(start_index, end_index, selection_network_path);
responses.add(NodeGraphMessage::SendGraph);
responses.add(NodeGraphMessage::RunDocumentGraph);
}
NodeGraphMessage::ReorderExport { start_index, end_index... | No issues found. | NodeGraphMessage::ReorderImport { start_index, end_index } => {
network_interface.reorder_import(start_index, end_index, selection_network_path);
responses.add(NodeGraphMessage::SendGraph);
responses.add(NodeGraphMessage::RunDocumentGraph);
}
NodeGraphMessage::ReorderExport { start_index, end_index... | @@ -302,6 +302,30 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphHandlerData<'a>> for NodeGrap
return;
}
+ let Some(network_metadata) = network_interface.network_metadata(selection_network_path) else {
+ log::error!("Could not get network metadata in NodeGraphMessage::EnterNestedNetwork");
+ ... | editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Make the node catalog, originating from a wire dropped in the graph, filter for valid types | 2,423 | GraphiteEditor/Graphite | 17,935 | Rust | singhutsav5502 | Review this pull request change.
Language: Rust
File: editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs
PR Title: Make the node catalog, originating from a wire dropped in the graph, filter for valid types
BEFORE CODE: NodeGraphMessage::ReorderImport { start_index, end_index } => {
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
pub fn as_solid(&self) -> Option<Color> {
let Self::Solid(color) = self else { return None };
Some(*color)
}
pub fn as_gradient(&self) -> Option<&GradientStops> {
let Self::Gradient(gradient) = self else { return None };
Some(gradient)
}
/// Convert this [`FillChoice`] to a [`Fill`] using the provided [`... | No issues found. | pub fn as_solid(&self) -> Option<Color> {
let Self::Solid(color) = self else { return None };
Some(*color)
}
pub fn as_gradient(&self) -> Option<&GradientStops> {
let Self::Gradient(gradient) = self else { return None };
Some(gradient)
}
/// Convert this [`FillChoice`] to a [`Fill`] using the provided [`... | @@ -15,9 +15,10 @@ pub enum GradientType {
}
// TODO: Someday we could switch this to a Box[T] to avoid over-allocation
+// TODO: Use linear not gamma colors
/// A list of colors associated with positions (in the range 0 to 1) along a gradient.
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserializ... | node-graph/gcore/src/vector/style.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Refactor many usages of Color to natively store linear not gamma | 2,457 | GraphiteEditor/Graphite | 17,935 | Rust | Keavon | Review this pull request change.
Language: Rust
File: node-graph/gcore/src/vector/style.rs
PR Title: Refactor many usages of Color to natively store linear not gamma
BEFORE CODE: pub fn as_solid(&self) -> Option<Color> {
let Self::Solid(color) = self else { return None };
Some(*color)
}
pub fn as_gradient(&... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
return Error::new(e.span(), format!("Failed to parse node function: {e}")).to_compile_error();
};
parsed_node.replace_impl_trait_in_input();
if let Err(e) = crate::validation::validate_node_fn(&parsed_node) {
return Error::new(e.span(), format!("Validation Error:\n{e}")).to_compile_error();
}
match generate_n... | No issues found. | return Error::new(e.span(), format!("Failed to parse node function: {e}")).to_compile_error();
};
parsed_node.replace_impl_trait_in_input();
if let Err(e) = crate::validation::validate_node_fn(&parsed_node) {
return Error::new(e.span(), format!("Validation Error:\n{e}")).to_compile_error();
}
match generate_n... | @@ -105,8 +105,10 @@ pub(crate) enum ParsedField {
ty: Type,
exposed: bool,
value_source: ParsedValueSource,
- number_min: Option<LitFloat>,
- number_max: Option<LitFloat>,
+ number_soft_min: Option<LitFloat>,
+ number_soft_max: Option<LitFloat>,
+ number_hard_min: Option<LitFloat>,
+ number_hard_max: Op... | node-graph/node-macro/src/parsing.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Update #[min/max] node macro attributes to #[soft/hard]_[min/max] and make them clamp their input data | 2,464 | GraphiteEditor/Graphite | 17,935 | Rust | mTvare6 | Review this pull request change.
Language: Rust
File: node-graph/node-macro/src/parsing.rs
PR Title: Update #[min/max] node macro attributes to #[soft/hard]_[min/max] and make them clamp their input data
BEFORE CODE: return Error::new(e.span(), format!("Failed to parse node function: {e}")).to_compile_error();
}... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if selected_gradient.gradient.stops.len() == 1 {
if let Some(layer) = selected_gradient.layer {
responses.add(GraphOperationMessage::FillSet {
layer,
fill: Fill::Solid(selected_gradient.gradient.stops[0].1),
});
}
return self;
}
// Find the minimum and maximum posit... | No issues found. | if selected_gradient.gradient.stops.len() == 1 {
if let Some(layer) = selected_gradient.layer {
responses.add(GraphOperationMessage::FillSet {
layer,
fill: Fill::Solid(selected_gradient.gradient.stops[0].1),
});
}
return self;
}
// Find the minimum and maximum posit... | @@ -516,3 +516,130 @@ impl Fsm for GradientToolFsmState {
responses.add(FrontendMessage::UpdateMouseCursor { cursor: MouseCursorIcon::Default });
}
}
+
+#[cfg(test)]
+mod test_gradient {
+ use crate::messages::portfolio::document::{graph_operation::utility_types::TransformIn, utility_types::misc::GroupFolderType}... | editor/src/messages/tool/tool_messages/gradient_tool.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add tests for gradient drawing with transformations | 2,481 | GraphiteEditor/Graphite | 17,935 | Rust | 0HyperCube | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/tool_messages/gradient_tool.rs
PR Title: Add tests for gradient drawing with transformations
BEFORE CODE: if selected_gradient.gradient.stops.len() == 1 {
if let Some(layer) = selected_gradient.layer {
responses.add(GraphO... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
// If both handles are selected, average the angles of the handles
else {
// We could normalize these directions?
let mut handle_directions = handle_positions.map(|handle| handle.map(|handle| handle - anchor));
let mut normalized = handle_directions[0].and_then(|a| handle_directions[1].and... | No issues found. | }
// If both handles are selected, average the angles of the handles
else {
// We could normalize these directions?
let mut handle_directions = handle_positions.map(|handle| handle.map(|handle| handle - anchor));
let mut normalized = handle_directions[0].and_then(|a| handle_directions[1].and... | @@ -104,6 +104,14 @@ impl ClosestSegment {
self.layer
}
+ pub fn segment(&self) -> SegmentId {
+ self.segment
+ }
+
+ pub fn points(&self) -> [PointId; 2] {
+ self.points
+ }
+
pub fn closest_point_to_viewport(&self) -> DVec2 {
self.bezier_point_to_viewport
}
@@ -128,9 +136,7 @@ impl ClosestSegment {
... | editor/src/messages/tool/common_functionality/shape_editor.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Insert point on segment by clicking once (no more sliding) and Alt+click to delete a segment | 2,495 | GraphiteEditor/Graphite | 17,935 | Rust | 4adex | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/common_functionality/shape_editor.rs
PR Title: Insert point on segment by clicking once (no more sliding) and Alt+click to delete a segment
BEFORE CODE: }
// If both handles are selected, average the angles of the handles
els... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
let Some(direction) = handle_directions[index] else { continue };
let new_position = direction.length() * normalized * sign;
let modification_type = handles[index].set_relative_position(new_position);
responses.add(GraphOperationMessage::Vector { layer, modification_type });
// Create the... | No issues found. | let Some(direction) = handle_directions[index] else { continue };
let new_position = direction.length() * normalized * sign;
let modification_type = handles[index].set_relative_position(new_position);
responses.add(GraphOperationMessage::Vector { layer, modification_type });
// Create the... | @@ -742,6 +742,7 @@ impl ShapeState {
delta: DVec2,
equidistant: bool,
in_viewport_space: bool,
+ was_alt_dragging: bool,
opposite_handle_position: Option<DVec2>,
responses: &mut VecDeque<Message>,
) {
@@ -810,9 +811,11 @@ impl ShapeState {
let length = opposing_handle.copied().unwrap_or_else(||... | editor/src/messages/tool/common_functionality/shape_editor.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add Path tool support for Alt-dragging an anchor to pull out a fresh equidistant handle pair | 2,496 | GraphiteEditor/Graphite | 17,935 | Rust | 4adex | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/common_functionality/shape_editor.rs
PR Title: Add Path tool support for Alt-dragging an anchor to pull out a fresh equidistant handle pair
BEFORE CODE: let Some(direction) = handle_directions[index] else { continue };
let ne... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
Self::DEFAULT
}
}
impl Footprint {
pub const DEFAULT: Self = Self {
transform: DAffine2::IDENTITY,
resolution: glam::UVec2::new(1920, 1080),
quality: RenderQuality::Full,
};
pub const BOUNDLESS: Self = Self {
transform: DAffine2 {
matrix2: DMat2::from_diagonal(DVec2::splat(f64::INFINITY)),
transla... | No issues found. | Self::DEFAULT
}
}
impl Footprint {
pub const DEFAULT: Self = Self {
transform: DAffine2::IDENTITY,
resolution: glam::UVec2::new(1920, 1080),
quality: RenderQuality::Full,
};
pub const BOUNDLESS: Self = Self {
transform: DAffine2 {
matrix2: DMat2::from_diagonal(DVec2::splat(f64::INFINITY)),
transla... | @@ -4,7 +4,8 @@ use crate::raster::bbox::AxisAlignedBbox;
use crate::raster::image::ImageFrameTable;
use crate::vector::VectorDataTable;
use crate::{Artboard, ArtboardGroupTable, CloneVarArgs, Color, Context, Ctx, ExtractAll, GraphicGroupTable, OwnedContextImpl};
-use glam::{DAffine2, DVec2};
+use core::f64;
+use gl... | node-graph/gcore/src/transform.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add 'Freeze Real Time' and 'Boundless Footprint' nodes as alternatives to using 'Memoize Impure' | 2,509 | GraphiteEditor/Graphite | 17,935 | Rust | TrueDoctor | Review this pull request change.
Language: Rust
File: node-graph/gcore/src/transform.rs
PR Title: Add 'Freeze Real Time' and 'Boundless Footprint' nodes as alternatives to using 'Memoize Impure'
BEFORE CODE: Self::DEFAULT
}
}
impl Footprint {
pub const DEFAULT: Self = Self {
transform: DAffine2::IDENTITY,
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
},
modifier_keys,
)
.await;
}
pub async fn drag_tool_cancel_rmb(&mut self, typ: ToolType) {
self.select_tool(typ).await;
self.move_mouse(50., 50., ModifierKeys::default(), MouseKeys::empty()).await;
self.left_mousedown(50., 50., ModifierKeys::default()).await;
self.move_mouse(100., 100., Modifie... | No issues found. | },
modifier_keys,
)
.await;
}
pub async fn drag_tool_cancel_rmb(&mut self, typ: ToolType) {
self.select_tool(typ).await;
self.move_mouse(50., 50., ModifierKeys::default(), MouseKeys::empty()).await;
self.left_mousedown(50., 50., ModifierKeys::default()).await;
self.move_mouse(100., 100., Modifie... | @@ -243,6 +243,18 @@ impl EditorTestUtils {
pub async fn get_selected_layer(&mut self) -> Option<LayerNodeIdentifier> {
self.active_document().network_interface.selected_nodes().selected_layers(self.active_document().metadata()).next()
}
+
+ pub async fn double_click(&mut self, position: DVec2) {
+ self.handle_... | editor/src/test_utils.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add Gradient tool test for select and delete removes a stop | 2,571 | GraphiteEditor/Graphite | 17,935 | Rust | Sidharth-Singh10 | Review this pull request change.
Language: Rust
File: editor/src/test_utils.rs
PR Title: Add Gradient tool test for select and delete removes a stop
BEFORE CODE: },
modifier_keys,
)
.await;
}
pub async fn drag_tool_cancel_rmb(&mut self, typ: ToolType) {
self.select_tool(typ).await;
self.move_mouse... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
self.mouseup(
EditorMouseState {
editor_position: (x2, y2).into(),
mouse_keys: MouseKeys::empty(),
scroll_delta: ScrollDelta::default(),
},
modifier_keys,
)
.await;
}
pub async fn drag_tool_cancel_rmb(&mut self, typ: ToolType) {
self.select_tool(typ).await;
self.move_mouse(50., 50., ... | No issues found. |
self.mouseup(
EditorMouseState {
editor_position: (x2, y2).into(),
mouse_keys: MouseKeys::empty(),
scroll_delta: ScrollDelta::default(),
},
modifier_keys,
)
.await;
}
pub async fn drag_tool_cancel_rmb(&mut self, typ: ToolType) {
self.select_tool(typ).await;
self.move_mouse(50., 50., ... | @@ -8,6 +8,7 @@ use crate::messages::tool::tool_messages::tool_prelude::Key;
use crate::messages::tool::utility_types::ToolType;
use crate::node_graph_executor::Instrumented;
use crate::node_graph_executor::NodeRuntime;
+use crate::test_utils::test_prelude::LayerNodeIdentifier;
use glam::DVec2;
use graph_craft::do... | editor/src/test_utils.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add Line tool tests for drawing within a transformed artboard | 2,572 | GraphiteEditor/Graphite | 17,935 | Rust | rahat2134 | Review this pull request change.
Language: Rust
File: editor/src/test_utils.rs
PR Title: Add Line tool tests for drawing within a transformed artboard
BEFORE CODE:
self.mouseup(
EditorMouseState {
editor_position: (x2, y2).into(),
mouse_keys: MouseKeys::empty(),
scroll_delta: ScrollDelta::default(... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
self.layer_bounding_box,
document_to_viewport,
pivot,
self.initial_transform,
);
}
};
}
self.mouse_position = input.mouse.position;
}
TransformLayerMessage::SelectionChanged => {
let target_layers = document.network_interface.selected_nodes().selected... | No issues found. | self.layer_bounding_box,
document_to_viewport,
pivot,
self.initial_transform,
);
}
};
}
self.mouse_position = input.mouse.position;
}
TransformLayerMessage::SelectionChanged => {
let target_layers = document.network_interface.selected_nodes().selected... | @@ -745,7 +745,7 @@ mod test_transform_layer {
editor.handle_message(TransformLayerMessage::BeginGrab).await;
- let translation = DVec2::new(50.0, 50.0);
+ let translation = DVec2::new(50., 50.);
editor.move_mouse(translation.x, translation.y, ModifierKeys::empty(), MouseKeys::NONE).await;
editor
@@ -7... | editor/src/messages/tool/transform_layer/transform_layer_message_handler.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add Spline tool test for drawing with PTZ applied to the canvas view | 2,573 | GraphiteEditor/Graphite | 17,935 | Rust | rahat2134 | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/transform_layer/transform_layer_message_handler.rs
PR Title: Add Spline tool test for drawing with PTZ applied to the canvas view
BEFORE CODE: self.layer_bounding_box,
document_to_viewport,
pivot,
self.ini... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
self.move_mouse(x2, y2, modifier_keys, MouseKeys::LEFT).await;
self.mouseup(
EditorMouseState {
editor_position: (x2, y2).into(),
mouse_keys: MouseKeys::empty(),
scroll_delta: ScrollDelta::default(),
},
modifier_keys,
)
.await;
}
pub async fn drag_tool_cancel_rmb(&mut self, typ: ToolTyp... | No issues found. | self.move_mouse(x2, y2, modifier_keys, MouseKeys::LEFT).await;
self.mouseup(
EditorMouseState {
editor_position: (x2, y2).into(),
mouse_keys: MouseKeys::empty(),
scroll_delta: ScrollDelta::default(),
},
modifier_keys,
)
.await;
}
pub async fn drag_tool_cancel_rmb(&mut self, typ: ToolTyp... | @@ -230,6 +230,15 @@ impl EditorTestUtils {
})
.await;
}
+ pub async fn draw_spline(&mut self, points: &[DVec2]) {
+ self.select_tool(ToolType::Spline).await;
+
+ for &point in points {
+ self.click_tool(ToolType::Spline, MouseKeys::LEFT, point, ModifierKeys::empty()).await;
+ }
+
+ self.press(Key::Enter,... | editor/src/test_utils.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add tests for Spline tool to support continuing a previously drawn spline | 2,591 | GraphiteEditor/Graphite | 17,935 | Rust | Sidharth-Singh10 | Review this pull request change.
Language: Rust
File: editor/src/test_utils.rs
PR Title: Add tests for Spline tool to support continuing a previously drawn spline
BEFORE CODE: self.move_mouse(x2, y2, modifier_keys, MouseKeys::LEFT).await;
self.mouseup(
EditorMouseState {
editor_position: (x2, y2).into()... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
self.move_mouse(100., 100., ModifierKeys::default(), MouseKeys::LEFT).await;
self.mousedown(
EditorMouseState {
editor_position: (100., 100.).into(),
mouse_keys: MouseKeys::LEFT | MouseKeys::RIGHT,
scroll_delta: ScrollDelta::default(),
},
ModifierKeys::default(),
)
.await;
}
pub fn acti... | No issues found. | self.move_mouse(100., 100., ModifierKeys::default(), MouseKeys::LEFT).await;
self.mousedown(
EditorMouseState {
editor_position: (100., 100.).into(),
mouse_keys: MouseKeys::LEFT | MouseKeys::RIGHT,
scroll_delta: ScrollDelta::default(),
},
ModifierKeys::default(),
)
.await;
}
pub fn acti... | @@ -240,6 +240,7 @@ impl EditorTestUtils {
self.press(Key::Enter, ModifierKeys::empty()).await;
}
+
pub async fn get_selected_layer(&mut self) -> Option<LayerNodeIdentifier> {
self.active_document().network_interface.selected_nodes().selected_layers(self.active_document().metadata()).next()
}
@@ -255,6 +2... | editor/src/test_utils.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add tests for the Freehand tool | 2,599 | GraphiteEditor/Graphite | 17,935 | Rust | Sidharth-Singh10 | Review this pull request change.
Language: Rust
File: editor/src/test_utils.rs
PR Title: Add tests for the Freehand tool
BEFORE CODE: self.move_mouse(100., 100., ModifierKeys::default(), MouseKeys::LEFT).await;
self.mousedown(
EditorMouseState {
editor_position: (100., 100.).into(),
mouse_keys: Mous... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
// Update bounds if another `PointerMove` message comes before `ResizeArtboard` is finished.
bounds.bounds[0] = position.round();
bounds.bounds[1] = position.round() + size.round();
// Auto-panning
let messages = [
ArtboardToolMessage::PointerOutsideViewport { constrain_axis_or_aspect, c... | No issues found. | // Update bounds if another `PointerMove` message comes before `ResizeArtboard` is finished.
bounds.bounds[0] = position.round();
bounds.bounds[1] = position.round() + size.round();
// Auto-panning
let messages = [
ArtboardToolMessage::PointerOutsideViewport { constrain_axis_or_aspect, c... | @@ -267,7 +267,7 @@ impl Fsm for ArtboardToolFsmState {
let constrain_square = input.keyboard.get(constrain_axis_or_aspect as usize);
tool_data.resize_artboard(responses, document, input, from_center, constrain_square);
- // AutoPanning
+ // Auto-panning
let messages = [
ArtboardToolMessage... | editor/src/messages/tool/tool_messages/artboard_tool.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Fix 'Shallow Select' mode behavior for selection context transference | 2,604 | GraphiteEditor/Graphite | 17,935 | Rust | mTvare6 | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/tool_messages/artboard_tool.rs
PR Title: Fix 'Shallow Select' mode behavior for selection context transference
BEFORE CODE: // Update bounds if another `PointerMove` message comes before `ResizeArtboard` is finished.
bounds.bou... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
/// Finds the t value of point on the given path segment i.e fractional distance along the segment's total length.
/// It uses a binary search to find the value `t` such that the ratio `length_upto_t / total_length` approximates the input `distance`.
fn eval_pathseg_euclidian(path: kurbo::PathSeg, distance: f64, acc... | No issues found. | }
/// Finds the t value of point on the given path segment i.e fractional distance along the segment's total length.
/// It uses a binary search to find the value `t` such that the ratio `length_upto_t / total_length` approximates the input `distance`.
fn eval_pathseg_euclidian(path: kurbo::PathSeg, distance: f64, acc... | @@ -0,0 +1,108 @@
+/// Accuracy to find the position on [kurbo::Bezpath].
+const POSITION_ACCURACY: f64 = 1e-3;
+/// Accuracy to find the length of the [kurbo::PathSeg].
+const PERIMETER_ACCURACY: f64 = 1e-3;
+
+use kurbo::{BezPath, ParamCurve, ParamCurveDeriv, PathSeg, Point, Shape};
+
+pub fn position_on_bezpath(bezp... | node-graph/gcore/src/vector/algorithms/bezpath_algorithms.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Refactor the 'Position on Path' and 'Tangent on Path' nodes to use the Kurbo API | 2,611 | GraphiteEditor/Graphite | 17,935 | Rust | indierusty | Review this pull request change.
Language: Rust
File: node-graph/gcore/src/vector/algorithms/bezpath_algorithms.rs
PR Title: Refactor the 'Position on Path' and 'Tangent on Path' nodes to use the Kurbo API
BEFORE CODE: }
/// Finds the t value of point on the given path segment i.e fractional distance along the seg... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
let Some(layer) = document.network_interface.selected_nodes().selected_layers(document.metadata()).next() else {
return;
};
let Some(vector_data) = document.network_interface.compute_modified_vector(layer) else { return };
let Some(point_id) = shape_editor.selected_points().next().unwrap().get_anch... | No issues found. | let Some(layer) = document.network_interface.selected_nodes().selected_layers(document.metadata()).next() else {
return;
};
let Some(vector_data) = document.network_interface.compute_modified_vector(layer) else { return };
let Some(point_id) = shape_editor.selected_points().next().unwrap().get_anch... | @@ -67,6 +67,7 @@ pub enum PathToolMessage {
extend_selection: Key,
lasso_select: Key,
handle_drag_from_anchor: Key,
+ drag_restore_handle: Key,
},
NudgeSelectedPoints {
delta_x: f64,
@@ -362,7 +363,6 @@ struct PathToolData {
saved_points_before_handle_drag: Vec<ManipulatorPointId>,
handle_drag_tog... | editor/src/messages/tool/tool_messages/path_tool.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add Path tool support for Ctrl-dragging to pull out zero-length handles with angle locking | 2,620 | GraphiteEditor/Graphite | 17,935 | Rust | 0SlowPoke0 | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/tool_messages/path_tool.rs
PR Title: Add Path tool support for Ctrl-dragging to pull out zero-length handles with angle locking
BEFORE CODE: let Some(layer) = document.network_interface.selected_nodes().selected_layers(document.metad... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
pub fn update_clip_targets(&mut self, new_clip_targets: HashSet<NodeId>) {
self.document_metadata.clip_targets = new_clip_targets;
}
/// Update the vector modify of the layers
pub fn update_vector_modify(&mut self, new_vector_modify: HashMap<NodeId, VectorData>) {
self.document_metadata.vector_modify = new_vec... | No issues found. | pub fn update_clip_targets(&mut self, new_clip_targets: HashSet<NodeId>) {
self.document_metadata.clip_targets = new_clip_targets;
}
/// Update the vector modify of the layers
pub fn update_vector_modify(&mut self, new_vector_modify: HashMap<NodeId, VectorData>) {
self.document_metadata.vector_modify = new_vec... | @@ -12,7 +12,7 @@ use glam::{DAffine2, DVec2, IVec2};
use graph_craft::document::value::TaggedValue;
use graph_craft::document::{DocumentNode, DocumentNodeImplementation, NodeId, NodeInput, NodeNetwork, OldDocumentNodeImplementation, OldNodeNetwork};
use graph_craft::{Type, concrete};
-use graphene_std::renderer::{C... | editor/src/messages/portfolio/document/utility_types/network_interface.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add overlays for free-floating anchors on hovered/selected vector layers | 2,630 | GraphiteEditor/Graphite | 17,935 | Rust | seam0s-dev | Review this pull request change.
Language: Rust
File: editor/src/messages/portfolio/document/utility_types/network_interface.rs
PR Title: Add overlays for free-floating anchors on hovered/selected vector layers
BEFORE CODE: pub fn update_clip_targets(&mut self, new_clip_targets: HashSet<NodeId>) {
self.document_... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
let index_0_0 = inverse_orientation_index(self.orientation, 0, 0, self.width, self.height);
let index_0_1 = inverse_orientation_index(self.orientation, 0, 1, self.width, self.height);
let index_1_0 = inverse_orientation_index(self.orientation, 1, 0, self.width, self.height);
let column_step = (index_0_1.0 - in... | No issues found. | let index_0_0 = inverse_orientation_index(self.orientation, 0, 0, self.width, self.height);
let index_0_1 = inverse_orientation_index(self.orientation, 0, 1, self.width, self.height);
let index_1_0 = inverse_orientation_index(self.orientation, 1, 0, self.width, self.height);
let column_step = (index_0_1.0 - in... | @@ -1,16 +1,16 @@
-use crate::{Image, Pixel, Transform};
+use crate::{Image, OrientationValue, Pixel};
impl Image<u16> {
- pub fn transform_iter(&self) -> (usize, usize, impl Iterator<Item = Pixel> + use<'_>) {
- let (final_width, final_height) = if self.transform.will_swap_coordinates() {
+ pub fn orientation_iter... | libraries/rawkit/src/postprocessing/transform.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add basic thumbnail extraction to Rawkit | 2,659 | GraphiteEditor/Graphite | 17,935 | Rust | geom3trik | Review this pull request change.
Language: Rust
File: libraries/rawkit/src/postprocessing/transform.rs
PR Title: Add basic thumbnail extraction to Rawkit
BEFORE CODE: let index_0_0 = inverse_orientation_index(self.orientation, 0, 0, self.width, self.height);
let index_0_1 = inverse_orientation_index(self.orient... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
let segment = bezpath.get_seg(segment_index + 1).unwrap();
return (segment_index, eval_pathseg_euclidean(segment, t, POSITION_ACCURACY));
}
bezpath_t_value_to_parametric(bezpath, BezPathTValue::GlobalParametric(t), segments_length)
}
/// Finds the t value of point on the given path segment i.e fractional distanc... | No issues found. | let segment = bezpath.get_seg(segment_index + 1).unwrap();
return (segment_index, eval_pathseg_euclidean(segment, t, POSITION_ACCURACY));
}
bezpath_t_value_to_parametric(bezpath, BezPathTValue::GlobalParametric(t), segments_length)
}
/// Finds the t value of point on the given path segment i.e fractional distanc... | @@ -205,18 +205,11 @@ pub fn poisson_disk_points(bezpath_index: usize, bezpaths: &[(BezPath, Rect)], s
return Vec::new();
}
- let offset = DVec2::new(this_bbox.x0, this_bbox.y0);
- let (width, height) = (this_bbox.width(), this_bbox.height());
-
- // TODO: Optimize the following code and make it more robust
-
... | node-graph/gcore/src/vector/algorithms/bezpath_algorithms.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Optimize Poisson-disk point sampling by halving the number of line intersection checks with caching | 2,661 | GraphiteEditor/Graphite | 17,935 | Rust | Keavon | Review this pull request change.
Language: Rust
File: node-graph/gcore/src/vector/algorithms/bezpath_algorithms.rs
PR Title: Optimize Poisson-disk point sampling by halving the number of line intersection checks with caching
BEFORE CODE: let segment = bezpath.get_seg(segment_index + 1).unwrap();
return (segment... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
goal: DVec2,
max_distance: f64,
layers: impl Iterator<Item = LayerNodeIdentifier>,
exclude: T,
preferences: &PreferencesMessageHandler,
) -> Option<(LayerNodeIdentifier, PointId, DVec2)>
where
T: Fn(PointId) -> bool,
{
let mut best = None;
let mut best_distance_squared = max_distance * max_distance;
for layer ... | No issues found. | goal: DVec2,
max_distance: f64,
layers: impl Iterator<Item = LayerNodeIdentifier>,
exclude: T,
preferences: &PreferencesMessageHandler,
) -> Option<(LayerNodeIdentifier, PointId, DVec2)>
where
T: Fn(PointId) -> bool,
{
let mut best = None;
let mut best_distance_squared = max_distance * max_distance;
for layer ... | @@ -67,7 +67,7 @@ pub fn text_bounding_box(layer: LayerNodeIdentifier, document: &DocumentMessageH
Quad::from_box([DVec2::ZERO, far])
}
-pub fn calculate_segment_angle(anchor: PointId, segment: SegmentId, vector_data: &VectorData, pen_tool: bool) -> Option<f64> {
+pub fn calculate_segment_angle(anchor: PointId, se... | editor/src/messages/tool/common_functionality/utility_functions.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Implement angle locking when Ctrl is pressed over an adjacent anchor | 2,663 | GraphiteEditor/Graphite | 17,935 | Rust | 0SlowPoke0 | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/common_functionality/utility_functions.rs
PR Title: Implement angle locking when Ctrl is pressed over an adjacent anchor
BEFORE CODE: goal: DVec2,
max_distance: f64,
layers: impl Iterator<Item = LayerNodeIdentifier>,
exclude: T,
pre... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
/// Assumes all selected manipulators have handles that are already not colinear.
pub fn convert_selected_manipulators_to_colinear_handles(&self, responses: &mut VecDeque<Message>, document: &DocumentMessageHandler) {
let mut skip_set = HashSet::new();
for (&layer, layer_state) in self.selected_shape_state.iter(... | No issues found. | /// Assumes all selected manipulators have handles that are already not colinear.
pub fn convert_selected_manipulators_to_colinear_handles(&self, responses: &mut VecDeque<Message>, document: &DocumentMessageHandler) {
let mut skip_set = HashSet::new();
for (&layer, layer_state) in self.selected_shape_state.iter(... | @@ -2,12 +2,14 @@ use super::graph_modification_utils::{self, merge_layers};
use super::snapping::{SnapCache, SnapCandidatePoint, SnapData, SnapManager, SnappedPoint};
use super::utility_functions::calculate_segment_angle;
use crate::consts::HANDLE_LENGTH_FACTOR;
+use crate::messages::portfolio::document::overlays::... | editor/src/messages/tool/common_functionality/shape_editor.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Make the Path tool only allow selecting points that are visible | 2,668 | GraphiteEditor/Graphite | 17,935 | Rust | 4adex | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/common_functionality/shape_editor.rs
PR Title: Make the Path tool only allow selecting points that are visible
BEFORE CODE: /// Assumes all selected manipulators have handles that are already not colinear.
pub fn convert_selected_manip... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
/// Enumerate all segments that end at the point.
pub fn end_connected(&self, point: PointId) -> impl Iterator<Item = SegmentId> + '_ {
let index = [self.point_domain.resolve_id(point)].into_iter().flatten();
index.flat_map(|index| self.segment_domain.end_connected(index))
}
/// Enumerate all segments that st... | No issues found. |
/// Enumerate all segments that end at the point.
pub fn end_connected(&self, point: PointId) -> impl Iterator<Item = SegmentId> + '_ {
let index = [self.point_domain.resolve_id(point)].into_iter().flatten();
index.flat_map(|index| self.segment_domain.end_connected(index))
}
/// Enumerate all segments that st... | @@ -2,7 +2,7 @@ mod attributes;
mod indexed;
mod modification;
-use super::misc::point_to_dvec2;
+use super::misc::{dvec2_to_point, point_to_dvec2};
use super::style::{PathStyle, Stroke};
use crate::instances::Instances;
use crate::{AlphaBlending, Color, GraphicGroupTable};
@@ -12,6 +12,7 @@ use core::borrow::Bo... | node-graph/gcore/src/vector/vector_data.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | New nodes: 'Point Inside Shape' and 'Close Path' | 2,673 | GraphiteEditor/Graphite | 17,935 | Rust | 0SlowPoke0 | Review this pull request change.
Language: Rust
File: node-graph/gcore/src/vector/vector_data.rs
PR Title: New nodes: 'Point Inside Shape' and 'Close Path'
BEFORE CODE:
/// Enumerate all segments that end at the point.
pub fn end_connected(&self, point: PointId) -> impl Iterator<Item = SegmentId> + '_ {
let in... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
self.temporary_colinear_handles = false;
skip_opposite = true;
}
shape_editor.move_selected_points(handle_lengths, document, snapped_delta, equidistant, true, was_alt_dragging, opposite, skip_opposite, responses);
self.previous_mouse_position += document_to_viewport.inverse().transform_vector2(snapped_... | No issues found. | self.temporary_colinear_handles = false;
skip_opposite = true;
}
shape_editor.move_selected_points(handle_lengths, document, snapped_delta, equidistant, true, was_alt_dragging, opposite, skip_opposite, responses);
self.previous_mouse_position += document_to_viewport.inverse().transform_vector2(snapped_... | @@ -1129,7 +1129,7 @@ impl Fsm for PathToolFsmState {
Self::Ready => {
if let Some(closest_segment) = &tool_data.segment {
let perp = closest_segment.calculate_perp(document);
- let point = closest_segment.closest_point_to_viewport();
+ let point = closest_segment.closest_point(document... | editor/src/messages/tool/tool_messages/path_tool.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Fix the Path tool's segment insertion line overlay having hysteresis with distance away from the cursor | 2,677 | GraphiteEditor/Graphite | 17,935 | Rust | 4adex | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/tool_messages/path_tool.rs
PR Title: Fix the Path tool's segment insertion line overlay having hysteresis with distance away from the cursor
BEFORE CODE: self.temporary_colinear_handles = false;
skip_opposite = true;
}
shap... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
return;
}
let x_offset = (((min_x - origin.x) / spacing_x).ceil()) * spacing_x + origin.x - min_x;
for line_index in 0..=lines {
let y_pos = (((inverse_project(&min_y) - origin.y) / spacing_y).ceil() + line_index as f64) * spacing_y + origin.y;
let start = DVec2::new(min_x + x_offset, project(&DVec2::new(min_x... | No issues found. | return;
}
let x_offset = (((min_x - origin.x) / spacing_x).ceil()) * spacing_x + origin.x - min_x;
for line_index in 0..=lines {
let y_pos = (((inverse_project(&min_y) - origin.y) / spacing_y).ceil() + line_index as f64) * spacing_y + origin.y;
let start = DVec2::new(min_x + x_offset, project(&DVec2::new(min_x... | @@ -236,12 +236,24 @@ pub fn overlay_options(grid: &GridSnapping) -> Vec<LayoutGroup> {
TextLabel::new("Type").table_align(true).widget_holder(),
Separator::new(SeparatorType::Unrelated).widget_holder(),
RadioInput::new(vec![
- RadioEntryData::new("rectangular")
- .label("Rectangular")
- .on_upda... | editor/src/messages/portfolio/document/overlays/grid_overlays.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Fix grid overlay values getting wiped when switching between isometric/rectangular and back | 2,702 | GraphiteEditor/Graphite | 17,935 | Rust | mTvare6 | Review this pull request change.
Language: Rust
File: editor/src/messages/portfolio/document/overlays/grid_overlays.rs
PR Title: Fix grid overlay values getting wiped when switching between isometric/rectangular and back
BEFORE CODE: return;
}
let x_offset = (((min_x - origin.x) / spacing_x).ceil()) * spacing_x... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
BlendMode::Lighten => background.blend_rgb(foreground, Color::blend_lighten),
BlendMode::Screen => background.blend_rgb(foreground, Color::blend_screen),
BlendMode::ColorDodge => background.blend_rgb(foreground, Color::blend_color_dodge),
BlendMode::LinearDodge => background.blend_rgb(foreground, Color::blend_l... | No issues found. | BlendMode::Lighten => background.blend_rgb(foreground, Color::blend_lighten),
BlendMode::Screen => background.blend_rgb(foreground, Color::blend_screen),
BlendMode::ColorDodge => background.blend_rgb(foreground, Color::blend_color_dodge),
BlendMode::LinearDodge => background.blend_rgb(foreground, Color::blend_l... | @@ -1,9 +1,7 @@
#![allow(clippy::too_many_arguments)]
use crate::raster::curve::{CubicSplines, CurveManipulatorGroup};
-#[cfg(feature = "alloc")]
use crate::raster::curve::{Curve, ValueMapperNode};
-#[cfg(feature = "alloc")]
use crate::raster::image::{Image, RasterDataTable};
use crate::raster::{Channel, Color, ... | node-graph/gcore/src/raster/adjustments.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Make `gcore` a std library and remove `std`, `alloc`, and more unused features | 2,724 | GraphiteEditor/Graphite | 17,935 | Rust | Firestar99 | Review this pull request change.
Language: Rust
File: node-graph/gcore/src/raster/adjustments.rs
PR Title: Make `gcore` a std library and remove `std`, `alloc`, and more unused features
BEFORE CODE: BlendMode::Lighten => background.blend_rgb(foreground, Color::blend_lighten),
BlendMode::Screen => background.ble... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
}
GraphicElement::GraphicGroup(graphic_group) => {
let mut graphic_group = graphic_group.clone();
for instance in graphic_group.instance_mut_iter() {
*instance.transform = *current_element.transform * *instance.transform;
}
flatten_group(&graphic_group, output);
}
_ => ... | No issues found. | }
}
GraphicElement::GraphicGroup(graphic_group) => {
let mut graphic_group = graphic_group.clone();
for instance in graphic_group.instance_mut_iter() {
*instance.transform = *current_element.transform * *instance.transform;
}
flatten_group(&graphic_group, output);
}
_ => ... | @@ -1,4 +1,4 @@
-use super::algorithms::bezpath_algorithms::{self, position_on_bezpath, sample_points_on_bezpath, split_bezpath, tangent_on_bezpath};
+use super::algorithms::bezpath_algorithms::{self, position_on_bezpath, sample_polyline_on_bezpath, split_bezpath, tangent_on_bezpath};
use super::algorithms::offset_sub... | node-graph/gcore/src/vector/vector_nodes.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Rename 'Sample Points' node to 'Sample Polyline' and add a parameter spacing based on separation or quantity | 2,727 | GraphiteEditor/Graphite | 17,935 | Rust | Moharum1 | Review this pull request change.
Language: Rust
File: node-graph/gcore/src/vector/vector_nodes.rs
PR Title: Rename 'Sample Points' node to 'Sample Polyline' and add a parameter spacing based on separation or quantity
BEFORE CODE: }
}
GraphicElement::GraphicGroup(graphic_group) => {
let mut graphic... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
},
DocumentNodeMetadata {
persistent_metadata: DocumentNodePersistentMetadata {
display_name: "Path Modify".to_string(),
node_type_metadata: NodeTypePersistentMetadata::node(IVec2::new(7, 0)),
..Default::default()
},
..Default::default()
}... | No issues found. | },
DocumentNodeMetadata {
persistent_metadata: DocumentNodePersistentMetadata {
display_name: "Path Modify".to_string(),
node_type_metadata: NodeTypePersistentMetadata::node(IVec2::new(7, 0)),
..Default::default()
},
..Default::default()
}... | @@ -14,14 +14,14 @@ use graph_craft::ProtoNodeIdentifier;
use graph_craft::concrete;
use graph_craft::document::value::*;
use graph_craft::document::*;
-use graphene_core::raster::brush_cache::BrushCache;
-use graphene_core::raster::image::RasterDataTable;
-use graphene_core::raster::{CellularDistanceFunction, Cellu... | editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Bulk rename `gcore` -> `gstd` in editor | 2,729 | GraphiteEditor/Graphite | 17,935 | Rust | Firestar99 | Review this pull request change.
Language: Rust
File: editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs
PR Title: Bulk rename `gcore` -> `gstd` in editor
BEFORE CODE: },
DocumentNodeMetadata {
persistent_metadata: DocumentNodePersistentMetadata {
displ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
let start = center + radius * start_vec;
let end = center + radius * end_vec;
let handle_start = start + start_vec.perp() * radius * factor;
let handle_end = end - end_vec.perp() * radius * factor;
let bezier = Bezier {
start,
end,
handles: bezier_rs::BezierHandles::Cubic { handle_start, ha... | No issues found. | let start = center + radius * start_vec;
let end = center + radius * end_vec;
let handle_start = start + start_vec.perp() * radius * factor;
let handle_end = end - end_vec.perp() * radius * factor;
let bezier = Bezier {
start,
end,
handles: bezier_rs::BezierHandles::Cubic { handle_start, ha... | @@ -814,6 +814,36 @@ impl OverlayContext {
self.render_context.fill_text(text, 0., 0.).expect("Failed to draw the text at the calculated position");
self.render_context.reset_transform().expect("Failed to reset the render context transform");
}
+
+ pub fn translation_box(&mut self, translation: DVec2, quad: Qua... | editor/src/messages/portfolio/document/overlays/utility_types.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add X and Y offset distance overlay while dragging with the Select tool | 2,814 | GraphiteEditor/Graphite | 17,935 | Rust | Kavin006 | Review this pull request change.
Language: Rust
File: editor/src/messages/portfolio/document/overlays/utility_types.rs
PR Title: Add X and Y offset distance overlay while dragging with the Select tool
BEFORE CODE: let start = center + radius * start_vec;
let end = center + radius * end_vec;
let handle_sta... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
pub font_size: f64,
pub line_height_ratio: f64,
pub character_spacing: f64,
pub max_width: Option<f64>,
pub max_height: Option<f64>,
pub tilt: f64,
}
impl Default for TypesettingConfig {
fn default() -> Self {
Self {
font_size: 24.,
line_height_ratio: 1.2,
character_spacing: 0.,
max_width: None,
... | No issues found. | pub font_size: f64,
pub line_height_ratio: f64,
pub character_spacing: f64,
pub max_width: Option<f64>,
pub max_height: Option<f64>,
pub tilt: f64,
}
impl Default for TypesettingConfig {
fn default() -> Self {
Self {
font_size: 24.,
line_height_ratio: 1.2,
character_spacing: 0.,
max_width: None,
... | @@ -1,4 +1,5 @@
-use crate::vector::PointId;
+use crate::instances::Instance;
+use crate::vector::{PointId, VectorData, VectorDataTable};
use bezier_rs::{ManipulatorGroup, Subpath};
use core::cell::RefCell;
use glam::{DAffine2, DVec2};
@@ -20,24 +21,20 @@ thread_local! {
struct PathBuilder {
current_subpath: Su... | node-graph/gcore/src/text/to_path.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Separate the Text node's generated glyphs into separate vector table rows | 2,821 | GraphiteEditor/Graphite | 17,935 | Rust | BKSalman | Review this pull request change.
Language: Rust
File: node-graph/gcore/src/text/to_path.rs
PR Title: Separate the Text node's generated glyphs into separate vector table rows
BEFORE CODE: pub font_size: f64,
pub line_height_ratio: f64,
pub character_spacing: f64,
pub max_width: Option<f64>,
pub max_height: Opt... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
// Resolve the result from the inspection by accessing the monitor node
let inspect_result = self.inspect_state.and_then(|state| state.access(&self.executor));
self.sender.send_execution_response(ExecutionResponse {
execution_id,
result,
responses,
transform,
vector_modify:... | No issues found. | // Resolve the result from the inspection by accessing the monitor node
let inspect_result = self.inspect_state.and_then(|state| state.access(&self.executor));
self.sender.send_execution_response(ExecutionResponse {
execution_id,
result,
responses,
transform,
vector_modify:... | @@ -328,6 +328,18 @@ impl NodeRuntime {
return;
}
+ // Skip thumbnails if the layer is too complex (for performance)
+ if graphic_element.render_complexity() > 1000 {
+ let old = thumbnail_renders.insert(parent_network_node_id, Vec::new());
+ if old.is_none_or(|v| !v.is_empty()) {
+ responses.push_bac... | editor/src/node_graph_executor/runtime.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add a complexity limit on displaying layer thumbnails to improve performance | 2,828 | GraphiteEditor/Graphite | 17,935 | Rust | 0HyperCube | Review this pull request change.
Language: Rust
File: editor/src/node_graph_executor/runtime.rs
PR Title: Add a complexity limit on displaying layer thumbnails to improve performance
BEFORE CODE: // Resolve the result from the inspection by accessing the monitor node
let inspect_result = self.inspect_stat... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
pub device: Arc<Device>,
pub queue: Arc<Queue>,
pub instance: Arc<Instance>,
pub adapter: Arc<wgpu::Adapter>,
}
impl Context {
pub async fn new() -> Option<Self> {
// Instantiates instance of WebGPU
let instance_descriptor = wgpu::InstanceDescriptor {
backends: wgpu::Backends::all(),
..Default::default(... | No issues found. | pub device: Arc<Device>,
pub queue: Arc<Queue>,
pub instance: Arc<Instance>,
pub adapter: Arc<wgpu::Adapter>,
}
impl Context {
pub async fn new() -> Option<Self> {
// Instantiates instance of WebGPU
let instance_descriptor = wgpu::InstanceDescriptor {
backends: wgpu::Backends::all(),
..Default::default(... | @@ -16,34 +16,32 @@ impl Context {
backends: wgpu::Backends::all(),
..Default::default()
};
- let instance = Instance::new(instance_descriptor);
+ let instance = Instance::new(&instance_descriptor);
let adapter_options = wgpu::RequestAdapterOptions {
power_preference: wgpu::PowerPreference::HighPe... | node-graph/wgpu-executor/src/context.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Upgrade vello to version 0.5.0 and wgpu to version 25 | 2,890 | GraphiteEditor/Graphite | 17,935 | Rust | mTvare6 | Review this pull request change.
Language: Rust
File: node-graph/wgpu-executor/src/context.rs
PR Title: Upgrade vello to version 0.5.0 and wgpu to version 25
BEFORE CODE: pub device: Arc<Device>,
pub queue: Arc<Queue>,
pub instance: Arc<Instance>,
pub adapter: Arc<wgpu::Adapter>,
}
impl Context {
pub async fn... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
]
.into_iter()
.enumerate()
.map(|(id, node)| (NodeId(id as u64), node))
.collect(),
..Default::default()
},
..Default::default()
}),
..Default::default()
},
},
description: Cow::Borrowed("TODO"),
properties: None,
},
DocumentNodeDefinitio... | No issues found. | ]
.into_iter()
.enumerate()
.map(|(id, node)| (NodeId(id as u64), node))
.collect(),
..Default::default()
},
..Default::default()
}),
..Default::default()
},
},
description: Cow::Borrowed("TODO"),
properties: None,
},
DocumentNodeDefinitio... | @@ -1083,6 +1083,86 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
description: Cow::Borrowed("TODO"),
properties: None,
},
+ #[cfg(feature = "gpu")]
+ DocumentNodeDefinition {
+ identifier: "Upload Texture",
+ category: "Debug: GPU",
+ node_template: NodeTemplate {
+ document_node: Documen... | editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Re-add upload texture | 2,915 | GraphiteEditor/Graphite | 17,935 | Rust | Firestar99 | Review this pull request change.
Language: Rust
File: editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs
PR Title: Re-add upload texture
BEFORE CODE: ]
.into_iter()
.enumerate()
.map(|(id, node)| (NodeId(id as u64), node))
.collect(),
..Default::... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
fn window_size(&self) -> WindowSize;
fn draw(&self, frame_buffer: FrameBuffer);
/// Scheudule the main event loop to run the cef event loop after the timeout
/// [`_cef_browser_process_handler_t::on_schedule_message_pump_work`] for more documentation.
fn schedule_cef_message_loop_work(&self, scheduled_time: Insta... | No issues found. | fn window_size(&self) -> WindowSize;
fn draw(&self, frame_buffer: FrameBuffer);
/// Scheudule the main event loop to run the cef event loop after the timeout
/// [`_cef_browser_process_handler_t::on_schedule_message_pump_work`] for more documentation.
fn schedule_cef_message_loop_work(&self, scheduled_time: Insta... | @@ -1,5 +1,8 @@
-use crate::FrameBuffer;
-use std::time::Instant;
+use crate::{CustomEvent, FrameBuffer};
+use std::{
+ sync::{Arc, Mutex, mpsc::Receiver},
+ time::Instant,
+};
mod context;
mod dirs;
@@ -8,16 +11,17 @@ mod internal;
mod scheme_handler;
pub(crate) use context::{Context, InitError, Initialized, S... | desktop/src/cef.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Desktop: Refactor window state to not require locking | 2,928 | GraphiteEditor/Graphite | 17,935 | Rust | TrueDoctor | Review this pull request change.
Language: Rust
File: desktop/src/cef.rs
PR Title: Desktop: Refactor window state to not require locking
BEFORE CODE: fn window_size(&self) -> WindowSize;
fn draw(&self, frame_buffer: FrameBuffer);
/// Scheudule the main event loop to run the cef event loop after the timeout
/// ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
height: size.height,
present_mode: surface_caps.present_modes[0],
alpha_mode: surface_caps.alpha_modes[0],
view_formats: vec![],
desired_maximum_frame_latency: 2,
};
surface.configure(&context.device, &config);
// Create shader module
let shader = context.device.create_shader_module(wgpu::inclu... | No issues found. | height: size.height,
present_mode: surface_caps.present_modes[0],
alpha_mode: surface_caps.alpha_modes[0],
view_formats: vec![],
desired_maximum_frame_latency: 2,
};
surface.configure(&context.device, &config);
// Create shader module
let shader = context.device.create_shader_module(wgpu::inclu... | @@ -3,36 +3,19 @@ use std::sync::Arc;
use thiserror::Error;
use winit::window::Window;
-pub(crate) struct FrameBuffer {
- buffer: Vec<u8>,
+pub(crate) struct FrameBufferRef<'a> {
+ buffer: &'a [u8],
width: usize,
height: usize,
}
-impl std::fmt::Debug for FrameBuffer {
- fn fmt(&self, f: &mut std::fmt::Formatt... | desktop/src/render.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Desktop: Directly upload frame buffer | 2,930 | GraphiteEditor/Graphite | 17,935 | Rust | TrueDoctor | Review this pull request change.
Language: Rust
File: desktop/src/render.rs
PR Title: Desktop: Directly upload frame buffer
BEFORE CODE: height: size.height,
present_mode: surface_caps.present_modes[0],
alpha_mode: surface_caps.alpha_modes[0],
view_formats: vec![],
desired_maximum_frame_latency: 2,
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if !queue.is_empty() {
self.message_queues.push(queue);
}
self.cleanup_queues(false);
}
}
pub fn collect_actions(&self) -> ActionList {
// TODO: Reduce the number of heap allocations
let mut list = Vec::new();
list.extend(self.message_handlers.dialog_message_handler.actions());
list.extend(se... | No issues found. | if !queue.is_empty() {
self.message_queues.push(queue);
}
self.cleanup_queues(false);
}
}
pub fn collect_actions(&self) -> ActionList {
// TODO: Reduce the number of heap allocations
let mut list = Vec::new();
list.extend(self.message_handlers.dialog_message_handler.actions());
list.extend(se... | @@ -5,7 +5,6 @@ use crate::messages::prelude::*;
#[derive(Debug, Default)]
pub struct Dispatcher {
- buffered_queue: Option<Vec<VecDeque<Message>>>,
message_queues: Vec<VecDeque<Message>>,
pub responses: Vec<FrontendMessage>,
pub message_handlers: DispatcherMessageHandlers,
@@ -17,6 +16,7 @@ pub struct Dispat... | editor/src/dispatcher.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add handler for deferred execution of messages | 2,951 | GraphiteEditor/Graphite | 17,935 | Rust | TrueDoctor | Review this pull request change.
Language: Rust
File: editor/src/dispatcher.rs
PR Title: Add handler for deferred execution of messages
BEFORE CODE: if !queue.is_empty() {
self.message_queues.push(queue);
}
self.cleanup_queues(false);
}
}
pub fn collect_actions(&self) -> ActionList {
// TODO: R... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
use super::*;
use std::sync::mpsc::{Receiver, Sender};
/// Handles communication with the NodeRuntime, either locally or via Tauri
#[derive(Debug)]
pub struct NodeRuntimeIO {
// Send to
sender: Sender<GraphRuntimeRequest>,
receiver: Receiver<NodeGraphUpdate>,
}
impl Default for NodeRuntimeIO {
fn default() -> Sel... | No issues found. | use super::*;
use std::sync::mpsc::{Receiver, Sender};
/// Handles communication with the NodeRuntime, either locally or via Tauri
#[derive(Debug)]
pub struct NodeRuntimeIO {
// Send to
sender: Sender<GraphRuntimeRequest>,
receiver: Receiver<NodeGraphUpdate>,
}
impl Default for NodeRuntimeIO {
fn default() -> Sel... | @@ -1,24 +1,11 @@
use super::*;
use std::sync::mpsc::{Receiver, Sender};
-use wasm_bindgen::prelude::*;
-
-#[wasm_bindgen]
-extern "C" {
- // Invoke with arguments (default)
- #[wasm_bindgen(js_namespace = ["window", "__TAURI__", "core"])]
- async fn invoke(cmd: &str, args: JsValue) -> JsValue;
- #[wasm_bindgen(js_na... | editor/src/node_graph_executor/runtime_io.rs | 0 | Rust | 1 | none | 16 | 45 | 45 | true | Desktop: Ready runtime and render node for desktop | 2,952 | GraphiteEditor/Graphite | 17,935 | Rust | TrueDoctor | Review this pull request change.
Language: Rust
File: editor/src/node_graph_executor/runtime_io.rs
PR Title: Desktop: Ready runtime and render node for desktop
BEFORE CODE: use super::*;
use std::sync::mpsc::{Receiver, Sender};
/// Handles communication with the NodeRuntime, either locally or via Tauri
#[derive(De... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
impl BrowserProcessLifeSpanHandlerImpl {
pub(crate) fn new() -> Self {
Self { object: std::ptr::null_mut() }
}
}
impl ImplLifeSpanHandler for BrowserProcessLifeSpanHandlerImpl {
fn on_before_popup(
&self,
_browser: Option<&mut cef::Browser>,
_frame: Option<&mut cef::Frame>,
_popup_id: ::std::os::raw::c_in... | No issues found. | impl BrowserProcessLifeSpanHandlerImpl {
pub(crate) fn new() -> Self {
Self { object: std::ptr::null_mut() }
}
}
impl ImplLifeSpanHandler for BrowserProcessLifeSpanHandlerImpl {
fn on_before_popup(
&self,
_browser: Option<&mut cef::Browser>,
_frame: Option<&mut cef::Frame>,
_popup_id: ::std::os::raw::c_in... | @@ -0,0 +1,64 @@
+use cef::rc::{Rc, RcImpl};
+use cef::sys::{_cef_life_span_handler_t, cef_base_ref_counted_t};
+use cef::{ImplLifeSpanHandler, WrapLifeSpanHandler};
+
+pub(crate) struct BrowserProcessLifeSpanHandlerImpl {
+ object: *mut RcImpl<_cef_life_span_handler_t, Self>,
+}
+impl BrowserProcessLifeSpanHandlerImpl... | desktop/src/cef/internal/browser_process_life_span_handler.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Desktop: Open links in default browser and prevent popups | 3,006 | GraphiteEditor/Graphite | 17,935 | Rust | timon-schelling | Review this pull request change.
Language: Rust
File: desktop/src/cef/internal/browser_process_life_span_handler.rs
PR Title: Desktop: Open links in default browser and prevent popups
BEFORE CODE: impl BrowserProcessLifeSpanHandlerImpl {
pub(crate) fn new() -> Self {
Self { object: std::ptr::null_mut() }
}
}
i... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
create_browser(event_handler, instance_dir, disable_gpu_acceleration)
}
#[cfg(not(target_os = "macos"))]
pub(crate) fn initialize(self, event_handler: H, disable_gpu_acceleration: bool) -> Result<impl CefContext, InitError> {
let instance_dir = create_instance_dir();
let settings = Settings {
windowless_r... | No issues found. | create_browser(event_handler, instance_dir, disable_gpu_acceleration)
}
#[cfg(not(target_os = "macos"))]
pub(crate) fn initialize(self, event_handler: H, disable_gpu_acceleration: bool) -> Result<impl CefContext, InitError> {
let instance_dir = create_instance_dir();
let settings = Settings {
windowless_r... | @@ -63,7 +63,7 @@ impl<H: CefEventHandler> CefContextBuilder<H> {
}
#[cfg(target_os = "macos")]
- pub(crate) fn initialize(self, event_handler: H) -> Result<impl CefContext, InitError> {
+ pub(crate) fn initialize(self, event_handler: H, disable_gpu_acceleration: bool) -> Result<impl CefContext, InitError> {
l... | desktop/src/cef/context/builder.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Desktop: Add support for opening a .graphite file from a path passed as a launch argument | 3,059 | GraphiteEditor/Graphite | 17,935 | Rust | c-mateo | Review this pull request change.
Language: Rust
File: desktop/src/cef/context/builder.rs
PR Title: Desktop: Add support for opening a .graphite file from a path passed as a launch argument
BEFORE CODE: create_browser(event_handler, instance_dir, disable_gpu_acceleration)
}
#[cfg(not(target_os = "macos"))]
pub... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
// Adjacent reduced curves cannot intersect
if num_curves <= 2 {
return vec![];
}
// For each curve, look for intersections with every curve that is at least 2 indices away
quads1
.iter()
.take(num_curves - 2)
.enumerate()
.flat_map(|(index, &subsegment)| intersections_between_vectors_of_path_segments(... | No issues found. |
// Adjacent reduced curves cannot intersect
if num_curves <= 2 {
return vec![];
}
// For each curve, look for intersections with every curve that is at least 2 indices away
quads1
.iter()
.take(num_curves - 2)
.enumerate()
.flat_map(|(index, &subsegment)| intersections_between_vectors_of_path_segments(... | @@ -1,5 +1,24 @@
use super::contants::MIN_SEPARATION_VALUE;
use kurbo::{BezPath, DEFAULT_ACCURACY, ParamCurve, PathSeg, Shape};
+use lyon_geom::{CubicBezierSegment, Point};
+
+/// Converts a kurbo cubic bezier to a lyon_geom CubicBezierSegment
+fn kurbo_cubic_to_lyon(cubic: kurbo::CubicBez) -> CubicBezierSegment<f64>... | node-graph/gcore/src/vector/algorithms/intersection.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Improve snapping performance | 3,067 | GraphiteEditor/Graphite | 17,935 | Rust | TrueDoctor | Review this pull request change.
Language: Rust
File: node-graph/gcore/src/vector/algorithms/intersection.rs
PR Title: Improve snapping performance
BEFORE CODE:
// Adjacent reduced curves cannot intersect
if num_curves <= 2 {
return vec![];
}
// For each curve, look for intersections with every curve that i... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
#[inline(always)]
pub fn maximum_rgb_channels(&self) -> f32 {
self.red.max(self.green).max(self.blue)
}
// From https://stackoverflow.com/a/56678483/775283
#[inline(always)]
pub fn luminance_srgb(&self) -> f32 {
0.2126 * self.red + 0.7152 * self.green + 0.0722 * self.blue
}
// From https://en.wikipedi... | No issues found. | }
#[inline(always)]
pub fn maximum_rgb_channels(&self) -> f32 {
self.red.max(self.green).max(self.blue)
}
// From https://stackoverflow.com/a/56678483/775283
#[inline(always)]
pub fn luminance_srgb(&self) -> f32 {
0.2126 * self.red + 0.7152 * self.green + 0.0722 * self.blue
}
// From https://en.wikipedi... | @@ -4,9 +4,9 @@ use bytemuck::{Pod, Zeroable};
use core::fmt::Debug;
use core::hash::Hash;
use half::f16;
-#[cfg(target_arch = "spirv")]
+#[cfg(not(feature = "std"))]
use num_traits::Euclid;
-#[cfg(target_arch = "spirv")]
+#[cfg(not(feature = "std"))]
use num_traits::float::Float;
#[repr(C)]
@@ -439,9 +439,9 @@... | node-graph/gcore-shaders/src/color/color_types.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Shaders: more `graster-nodes` no-std fixups | 3,090 | GraphiteEditor/Graphite | 17,935 | Rust | Firestar99 | Review this pull request change.
Language: Rust
File: node-graph/gcore-shaders/src/color/color_types.rs
PR Title: Shaders: more `graster-nodes` no-std fixups
BEFORE CODE: }
#[inline(always)]
pub fn maximum_rgb_channels(&self) -> f32 {
self.red.max(self.green).max(self.blue)
}
// From https://stackoverflow.... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
bounding_box,
}
}
pub fn target_type(&self) -> &ClickTargetType {
&self.target_type
}
pub fn bounding_box(&self) -> Option<[DVec2; 2]> {
self.bounding_box
}
pub fn bounding_box_center(&self) -> Option<DVec2> {
self.bounding_box.map(|bbox| bbox[0] + (bbox[1] - bbox[0]) / 2.)
}
pub fn bounding_box_... | No issues found. | bounding_box,
}
}
pub fn target_type(&self) -> &ClickTargetType {
&self.target_type
}
pub fn bounding_box(&self) -> Option<[DVec2; 2]> {
self.bounding_box
}
pub fn bounding_box_center(&self) -> Option<DVec2> {
self.bounding_box.map(|bbox| bbox[0] + (bbox[1] - bbox[0]) / 2.)
}
pub fn bounding_box_... | @@ -1,12 +1,12 @@
-use super::algorithms::intersection::filtered_segment_intersections;
+use super::algorithms::{bezpath_algorithms::bezpath_is_inside_bezpath, intersection::filtered_segment_intersections};
use super::misc::dvec2_to_point;
use crate::math::math_ext::QuadExt;
use crate::math::quad::Quad;
use crate::... | node-graph/gcore/src/vector/click_target.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Fix box selection regression where only intersected, not contained, objects get selected | 3,093 | GraphiteEditor/Graphite | 17,935 | Rust | indierusty | Review this pull request change.
Language: Rust
File: node-graph/gcore/src/vector/click_target.rs
PR Title: Fix box selection regression where only intersected, not contained, objects get selected
BEFORE CODE: bounding_box,
}
}
pub fn target_type(&self) -> &ClickTargetType {
&self.target_type
}
pub fn ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
// https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#:~:text=Vibrance%20(Photoshop%20CS3)
//
// Algorithm based on:
// https://stackoverflow.com/questions/33966121/what-is-the-algorithm-for-vibrance-filters
// The results of this implementation are very close to correct, but not quite perfect.
//
// Some fu... | No issues found. | // https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#:~:text=Vibrance%20(Photoshop%20CS3)
//
// Algorithm based on:
// https://stackoverflow.com/questions/33966121/what-is-the-algorithm-for-vibrance-filters
// The results of this implementation are very close to correct, but not quite perfect.
//
// Some fu... | @@ -11,7 +11,7 @@ use graphene_core::raster_types::{CPU, Raster};
use graphene_core::table::Table;
use graphene_core_shaders::color::Color;
use graphene_core_shaders::context::Ctx;
-use graphene_core_shaders::registry::types::{Angle, Percentage, SignedPercentage};
+use graphene_core_shaders::registry::types::{AngleF... | node-graph/graster-nodes/src/adjustments.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add node input type support for `f32` to enable usage on GPU | 3,095 | GraphiteEditor/Graphite | 17,935 | Rust | Firestar99 | Review this pull request change.
Language: Rust
File: node-graph/graster-nodes/src/adjustments.rs
PR Title: Add node input type support for `f32` to enable usage on GPU
BEFORE CODE: // https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#:~:text=Vibrance%20(Photoshop%20CS3)
//
// Algorithm based on:
// htt... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
self.flush();
}
fn flush(&self) {
let data = match ron::to_string(self) {
Ok(d) => d,
Err(e) => {
tracing::error!("Failed to serialize persistent data: {e}");
return;
}
};
if let Err(e) = std::fs::write(Self::persistence_file_path(), data) {
tracing::error!("Failed to write persistent dat... | No issues found. | self.flush();
}
fn flush(&self) {
let data = match ron::to_string(self) {
Ok(d) => d,
Err(e) => {
tracing::error!("Failed to serialize persistent data: {e}");
return;
}
};
if let Err(e) = std::fs::write(Self::persistence_file_path(), data) {
tracing::error!("Failed to write persistent dat... | @@ -0,0 +1,192 @@
+use graphite_desktop_wrapper::messages::{Document, DocumentId};
+
+#[derive(Default, serde::Serialize, serde::Deserialize)]
+pub(crate) struct PersistentData {
+ documents: DocumentStore,
+ current_document: Option<DocumentId>,
+ #[serde(skip)]
+ document_order: Option<Vec<DocumentId>>,
+}
+
+impl Pe... | desktop/src/persist.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Desktop: Move autosave persistence to native | 3,134 | GraphiteEditor/Graphite | 17,935 | Rust | timon-schelling | Review this pull request change.
Language: Rust
File: desktop/src/persist.rs
PR Title: Desktop: Move autosave persistence to native
BEFORE CODE: self.flush();
}
fn flush(&self) {
let data = match ron::to_string(self) {
Ok(d) => d,
Err(e) => {
tracing::error!("Failed to serialize persistent data: {e... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
};
const onPointerMove = (e: PointerEvent) => {
const mouseCurrent = isHorizontal ? e.clientX : e.clientY;
let mouseDelta = mouseStart - mouseCurrent;
mouseDelta = Math.max(nextSiblingSize + mouseDelta, MIN_PANEL_SIZE) - nextSiblingSize;
mouseDelta = prevSiblingSize - Math.max(prevSiblingSize - m... | No issues found. | }
};
const onPointerMove = (e: PointerEvent) => {
const mouseCurrent = isHorizontal ? e.clientX : e.clientY;
let mouseDelta = mouseStart - mouseCurrent;
mouseDelta = Math.max(nextSiblingSize + mouseDelta, MIN_PANEL_SIZE) - nextSiblingSize;
mouseDelta = prevSiblingSize - Math.max(prevSiblingSize - m... | @@ -30,12 +30,12 @@
$: documentPanel?.scrollTabIntoView($portfolio.activeDocumentIndex);
$: documentTabLabels = $portfolio.documents.map((doc: OpenDocument) => {
- const name = doc.displayName;
-
- if (!editor.handle.inDevelopmentMode()) return { name };
+ const name = doc.details.name;
+ const unsaved = !doc... | frontend/src/components/window/workspace/Workspace.svelte | 0 | Svelte | 1 | none | 16 | 51 | 51 | true | Fix the ellipses of a long document name causing the tab's unsaved asterisk to be hidden | 3,146 | GraphiteEditor/Graphite | 17,935 | Rust | derfl007 | Review this pull request change.
Language: Svelte
File: frontend/src/components/window/workspace/Workspace.svelte
PR Title: Fix the ellipses of a long document name causing the tab's unsaved asterisk to be hidden
BEFORE CODE: }
};
const onPointerMove = (e: PointerEvent) => {
const mouseCurrent = isHorizo... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
..
}) if file_type != FileType::Svg => {
use image::buffer::ConvertBuffer;
use image::{ImageFormat, RgbImage, RgbaImage};
let Some(image) = RgbaImage::from_raw(width, height, data) else {
return Err(format!("Failed to create image buffer for export"));
};
let mut encoded = Vec::new();
... | No issues found. | ..
}) if file_type != FileType::Svg => {
use image::buffer::ConvertBuffer;
use image::{ImageFormat, RgbImage, RgbaImage};
let Some(image) = RgbaImage::from_raw(width, height, data) else {
return Err(format!("Failed to create image buffer for export"));
};
let mut encoded = Vec::new();
... | @@ -190,14 +190,20 @@ impl NodeGraphExecutor {
let size = bounds[1] - bounds[0];
let transform = DAffine2::from_translation(bounds[0]).inverse();
+ let export_format = if export_config.file_type == FileType::Svg || cfg!(not(feature = "gpu")) {
+ graphene_std::application_io::ExportFormat::Svg
+ } else {
+ ... | editor/src/node_graph_executor.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Desktop: Native export | 3,188 | GraphiteEditor/Graphite | 17,935 | Rust | timon-schelling | Review this pull request change.
Language: Rust
File: editor/src/node_graph_executor.rs
PR Title: Desktop: Native export
BEFORE CODE: ..
}) if file_type != FileType::Svg => {
use image::buffer::ConvertBuffer;
use image::{ImageFormat, RgbImage, RgbaImage};
let Some(image) = RgbaImage::from_raw(wi... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
impl DisplayHandlerImpl {
pub fn new() -> Self {
Self { object: std::ptr::null_mut() }
}
}
impl ImplDisplayHandler for DisplayHandlerImpl {
fn on_console_message(
&self,
_browser: Option<&mut cef::Browser>,
level: cef::LogSeverity,
message: Option<&CefString>,
source: Option<&CefString>,
line: ::std::... | No issues found. | impl DisplayHandlerImpl {
pub fn new() -> Self {
Self { object: std::ptr::null_mut() }
}
}
impl ImplDisplayHandler for DisplayHandlerImpl {
fn on_console_message(
&self,
_browser: Option<&mut cef::Browser>,
level: cef::LogSeverity,
message: Option<&CefString>,
source: Option<&CefString>,
line: ::std::... | @@ -0,0 +1,65 @@
+use cef::rc::{Rc, RcImpl};
+use cef::sys::{_cef_display_handler_t, cef_base_ref_counted_t, cef_log_severity_t::*};
+use cef::{CefString, ImplDisplayHandler, WrapDisplayHandler};
+
+pub(crate) struct DisplayHandlerImpl {
+ object: *mut RcImpl<_cef_display_handler_t, Self>,
+}
+
+impl DisplayHandlerImpl... | desktop/src/cef/internal/display_handler.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Desktop: Browser console message forwarding | 3,193 | GraphiteEditor/Graphite | 17,935 | Rust | timon-schelling | Review this pull request change.
Language: Rust
File: desktop/src/cef/internal/display_handler.rs
PR Title: Desktop: Browser console message forwarding
BEFORE CODE: impl DisplayHandlerImpl {
pub fn new() -> Self {
Self { object: std::ptr::null_mut() }
}
}
impl ImplDisplayHandler for DisplayHandlerImpl {
fn on... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => BrushCache]),
async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => DocumentNode]),
async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => graphene_std::Contex... | No issues found. | async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => BrushCache]),
async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => DocumentNode]),
async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => graphene_std::Contex... | @@ -61,6 +61,10 @@ fn node_registry() -> HashMap<ProtoNodeIdentifier, HashMap<NodeIOTypes, NodeCons
convert_node!(from: DVec2, to: String),
convert_node!(from: IVec2, to: String),
convert_node!(from: DAffine2, to: String),
+ convert_node!(from: Table<Raster<CPU>>, to: Table<Raster<CPU>>, converter: &WgpuExecu... | node-graph/interpreted-executor/src/node_registry.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Implement Convert trait to convert between CPU and GPU images | 3,194 | GraphiteEditor/Graphite | 17,935 | Rust | TrueDoctor | Review this pull request change.
Language: Rust
File: node-graph/interpreted-executor/src/node_registry.rs
PR Title: Implement Convert trait to convert between CPU and GPU images
BEFORE CODE: async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => BrushCache]),
async_node!(graphe... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
DesktopFrontendMessage::PersistenceWriteDocument { id, document } => {
self.persistent_data.write_document(id, document);
}
DesktopFrontendMessage::PersistenceDeleteDocument { id } => {
self.persistent_data.delete_document(&id);
}
DesktopFrontendMessage::PersistenceUpdateCurrentDocument { id... | No issues found. | }
DesktopFrontendMessage::PersistenceWriteDocument { id, document } => {
self.persistent_data.write_document(id, document);
}
DesktopFrontendMessage::PersistenceDeleteDocument { id } => {
self.persistent_data.delete_document(&id);
}
DesktopFrontendMessage::PersistenceUpdateCurrentDocument { id... | @@ -236,10 +236,9 @@ impl App {
self.persistent_data.write_preferences(preferences);
}
DesktopFrontendMessage::PersistenceLoadPreferences => {
- if let Some(preferences) = self.persistent_data.load_preferences() {
- let message = DesktopWrapperMessage::LoadPreferences { preferences };
- self.dis... | desktop/src/app.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Ensure the LoadPreferences message is dispatched with None when no preferences exist | 3,198 | GraphiteEditor/Graphite | 17,935 | Rust | timon-schelling | Review this pull request change.
Language: Rust
File: desktop/src/app.rs
PR Title: Ensure the LoadPreferences message is dispatched with None when no preferences exist
BEFORE CODE: }
DesktopFrontendMessage::PersistenceWriteDocument { id, document } => {
self.persistent_data.write_document(id, document);
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
&[BindGroupLayoutEntry {
binding: 0,
visibility: ShaderStages::FRAGMENT,
ty: BindingType::Texture {
sample_type: TextureSampleType::Float { filterable: false },
view_dimension: TextureViewDimension::D2,
multisampled: false,
},
count: None,
}]
};
let pipeline_layout = device.... | No issues found. | &[BindGroupLayoutEntry {
binding: 0,
visibility: ShaderStages::FRAGMENT,
ty: BindingType::Texture {
sample_type: TextureSampleType::Float { filterable: false },
view_dimension: TextureViewDimension::D2,
multisampled: false,
},
count: None,
}]
};
let pipeline_layout = device.... | @@ -1,4 +1,4 @@
-use crate::Context;
+use crate::WgpuContext;
use crate::shader_runtime::{FULLSCREEN_VERTEX_SHADER_NAME, ShaderRuntime};
use futures::lock::Mutex;
use graphene_core::raster_types::{GPU, Raster};
@@ -31,7 +31,7 @@ impl ShaderRuntime {
let mut cache = self.per_pixel_adjust.pipeline_cache.lock().awai... | node-graph/wgpu-executor/src/shader_runtime/per_pixel_adjust_runtime.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Desktop: Add rudimentary support for custom WGPU adapter selection | 3,201 | GraphiteEditor/Graphite | 17,935 | Rust | timon-schelling | Review this pull request change.
Language: Rust
File: node-graph/wgpu-executor/src/shader_runtime/per_pixel_adjust_runtime.rs
PR Title: Desktop: Add rudimentary support for custom WGPU adapter selection
BEFORE CODE: &[BindGroupLayoutEntry {
binding: 0,
visibility: ShaderStages::FRAGMENT,
ty: BindingT... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
let base_graphic_table = Table::new_from_element(Graphic::from(content));
flatten_table(&mut output, &base_graphic_table);
// Return the single-row Table<Vector> containing the flattened Vector subpaths
output_table
}
/// Convert vector geometry into a polyline composed of evenly spaced points.
#[node_macro::node... | No issues found. | let base_graphic_table = Table::new_from_element(Graphic::from(content));
flatten_table(&mut output, &base_graphic_table);
// Return the single-row Table<Vector> containing the flattened Vector subpaths
output_table
}
/// Convert vector geometry into a polyline composed of evenly spaced points.
#[node_macro::node... | @@ -1,3 +1,4 @@
+use core::cmp::Ordering;
use core::f64::consts::PI;
use core::hash::{Hash, Hasher};
use core_types::bounds::{BoundingBox, RenderBoundingBox};
@@ -21,7 +22,7 @@ use vector_types::vector::algorithms::bezpath_algorithms::{self, TValue, evaluat
use vector_types::vector::algorithms::merge_by_distance::M... | node-graph/nodes/vector/src/vector_nodes.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | New node: Pack Strips | 3,246 | GraphiteEditor/Graphite | 17,935 | Rust | otdavies | Review this pull request change.
Language: Rust
File: node-graph/nodes/vector/src/vector_nodes.rs
PR Title: New node: Pack Strips
BEFORE CODE: let base_graphic_table = Table::new_from_element(Graphic::from(content));
flatten_table(&mut output, &base_graphic_table);
// Return the single-row Table<Vector> contain... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
impl Transform for DAffine2 {
fn transform(&self) -> DAffine2 {
*self
}
}
impl TransformMut for DAffine2 {
fn transform_mut(&mut self) -> &mut DAffine2 {
self
}
}
// Implementations for Footprint
impl Transform for Footprint {
fn transform(&self) -> DAffine2 {
self.transform
}
}
impl TransformMut for Footp... | No issues found. | impl Transform for DAffine2 {
fn transform(&self) -> DAffine2 {
*self
}
}
impl TransformMut for DAffine2 {
fn transform_mut(&mut self) -> &mut DAffine2 {
self
}
}
// Implementations for Footprint
impl Transform for Footprint {
fn transform(&self) -> DAffine2 {
self.transform
}
}
impl TransformMut for Footp... | @@ -21,6 +21,23 @@ pub trait Transform {
let rotation = -rotation_matrix.mul_vec2(DVec2::X).angle_to(DVec2::X);
if rotation == -0. { 0. } else { rotation }
}
+
+ /// Detects if the transform contains skew by checking if the transformation matrix
+ /// deviates from a pure rotation + uniform scale + translation.... | node-graph/gcore/src/transform.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Cache calculation of bounding boxes with transforms | 3,287 | GraphiteEditor/Graphite | 17,935 | Rust | TrueDoctor | Review this pull request change.
Language: Rust
File: node-graph/gcore/src/transform.rs
PR Title: Cache calculation of bounding boxes with transforms
BEFORE CODE: impl Transform for DAffine2 {
fn transform(&self) -> DAffine2 {
*self
}
}
impl TransformMut for DAffine2 {
fn transform_mut(&mut self) -> &mut DAffi... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
// Build a new point domain with the original points, but with duplications based on their extra usages by the segments
for (index, (point_id, point)) in row.element.point_domain.iter().enumerate() {
// Ensure at least one usage to preserve free-floating points not connected to any segments
let usage_count = ... | No issues found. | // Build a new point domain with the original points, but with duplications based on their extra usages by the segments
for (index, (point_id, point)) in row.element.point_domain.iter().enumerate() {
// Ensure at least one usage to preserve free-floating points not connected to any segments
let usage_count = ... | @@ -1954,11 +1954,39 @@ fn point_inside(_: impl Ctx, source: Table<Vector>, point: DVec2) -> bool {
source.into_iter().any(|row| row.element.check_point_inside_shape(row.transform, point))
}
+trait Count {
+ fn count(&self) -> usize;
+}
+impl<T> Count for Table<T> {
+ fn count(&self) -> usize {
+ self.len()
+ }
+... | node-graph/gcore/src/vector/vector_nodes.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | New node: String Split | 3,304 | GraphiteEditor/Graphite | 17,935 | Rust | daniil-loban | Review this pull request change.
Language: Rust
File: node-graph/gcore/src/vector/vector_nodes.rs
PR Title: New node: String Split
BEFORE CODE: // Build a new point domain with the original points, but with duplications based on their extra usages by the segments
for (index, (point_id, point)) in row.element.po... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
view_info_receiver: Arc<Mutex<ViewInfoReceiver>>,
}
impl CefHandler {
pub(crate) fn new(wgpu_context: WgpuContext, app_event_scheduler: AppEventScheduler, view_info_receiver: Receiver<ViewInfoUpdate>) -> Self {
Self {
wgpu_context,
app_event_scheduler,
view_info_receiver: Arc::new(Mutex::new(ViewInfoRecei... | No issues found. | view_info_receiver: Arc<Mutex<ViewInfoReceiver>>,
}
impl CefHandler {
pub(crate) fn new(wgpu_context: WgpuContext, app_event_scheduler: AppEventScheduler, view_info_receiver: Receiver<ViewInfoUpdate>) -> Self {
Self {
wgpu_context,
app_event_scheduler,
view_info_receiver: Arc::new(Mutex::new(ViewInfoRecei... | @@ -38,8 +38,8 @@ use texture_import::SharedTextureHandle;
pub(crate) use context::{CefContext, CefContextBuilder, InitError};
-pub(crate) trait CefEventHandler: Clone + Send + Sync + 'static {
- fn window_size(&self) -> WindowSize;
+pub(crate) trait CefEventHandler: Send + Sync + 'static {
+ fn view_info(&self) -... | desktop/src/cef.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Desktop: Add support for UI scaling | 3,310 | GraphiteEditor/Graphite | 17,935 | Rust | timon-schelling | Review this pull request change.
Language: Rust
File: desktop/src/cef.rs
PR Title: Desktop: Add support for UI scaling
BEFORE CODE: view_info_receiver: Arc<Mutex<ViewInfoReceiver>>,
}
impl CefHandler {
pub(crate) fn new(wgpu_context: WgpuContext, app_event_scheduler: AppEventScheduler, view_info_receiver: Receiv... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
EditorMouseState {
editor_position: (100., 100.).into(),
mouse_keys: MouseKeys::LEFT | MouseKeys::RIGHT,
scroll_delta: ScrollDelta::default(),
},
ModifierKeys::default(),
)
.await;
}
pub fn active_document(&self) -> &DocumentMessageHandler {
self.editor.dispatcher.message_handlers.portfoli... | No issues found. | EditorMouseState {
editor_position: (100., 100.).into(),
mouse_keys: MouseKeys::LEFT | MouseKeys::RIGHT,
scroll_delta: ScrollDelta::default(),
},
ModifierKeys::default(),
)
.await;
}
pub fn active_document(&self) -> &DocumentMessageHandler {
self.editor.dispatcher.message_handlers.portfoli... | @@ -1,6 +1,7 @@
use crate::application::Editor;
use crate::application::set_uuid_seed;
use crate::messages::input_mapper::utility_types::input_keyboard::ModifierKeys;
+use crate::messages::input_mapper::utility_types::input_mouse::ViewportBounds;
use crate::messages::input_mapper::utility_types::input_mouse::{Edito... | editor/src/test_utils.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Fix snapping when drawing an artboard | 3,312 | GraphiteEditor/Graphite | 17,935 | Rust | 0HyperCube | Review this pull request change.
Language: Rust
File: editor/src/test_utils.rs
PR Title: Fix snapping when drawing an artboard
BEFORE CODE: EditorMouseState {
editor_position: (100., 100.).into(),
mouse_keys: MouseKeys::LEFT | MouseKeys::RIGHT,
scroll_delta: ScrollDelta::default(),
},
ModifierK... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
let mut dependencies = Vec::new();
let mut external_dependencies = Vec::new();
if let Some(deps) = &crate_toml.dependencies {
for (dep_name, dep_config) in deps {
let is_workspace_crate = workspace_crate_names.contains(dep_name);
let is_workspace_dep = workspace_deps.contains(dep_name);
let is_lo... | No issues found. | let mut dependencies = Vec::new();
let mut external_dependencies = Vec::new();
if let Some(deps) = &crate_toml.dependencies {
for (dep_name, dep_config) in deps {
let is_workspace_crate = workspace_crate_names.contains(dep_name);
let is_workspace_dep = workspace_deps.contains(dep_name);
let is_lo... | @@ -0,0 +1,401 @@
+use anyhow::{Context, Result, anyhow};
+use clap::{Parser, ValueEnum};
+use serde::Deserialize;
+use std::collections::{HashMap, HashSet};
+use std::fs;
+use std::path::PathBuf;
+use std::process::Command;
+
+#[derive(Debug, Clone, ValueEnum)]
+enum OutputFormat {
+ /// Output DOT format (GraphViz)
+... | tools/crate-hierarchy-viz/src/main.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add tool for visualizing crate hierarchy | 3,315 | GraphiteEditor/Graphite | 17,935 | Rust | TrueDoctor | Review this pull request change.
Language: Rust
File: tools/crate-hierarchy-viz/src/main.rs
PR Title: Add tool for visualizing crate hierarchy
BEFORE CODE: let mut dependencies = Vec::new();
let mut external_dependencies = Vec::new();
if let Some(deps) = &crate_toml.dependencies {
for (dep_name, dep_confi... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
let left = DVec2::new(corner1.x, center.y);
let right = DVec2::new(corner2.x, center.y);
// Based on https://pomax.github.io/bezierinfo/#circles_cubic
const HANDLE_OFFSET_FACTOR: f64 = 0.551784777779014;
let handle_offset = size * HANDLE_OFFSET_FACTOR * 0.5;
let manipulator_groups = vec![
ManipulatorGr... | No issues found. | let left = DVec2::new(corner1.x, center.y);
let right = DVec2::new(corner2.x, center.y);
// Based on https://pomax.github.io/bezierinfo/#circles_cubic
const HANDLE_OFFSET_FACTOR: f64 = 0.551784777779014;
let handle_offset = size * HANDLE_OFFSET_FACTOR * 0.5;
let manipulator_groups = vec![
ManipulatorGr... | @@ -312,6 +312,37 @@ impl<PointId: Identifier> Subpath<PointId> {
Self::from_anchors([p1, p2], false)
}
+ /// Constructs an arrow shape from start and end points with parametric control over dimensions
+ pub fn new_arrow(start: DVec2, end: DVec2, shaft_width: f64, head_width: f64, head_length: f64) -> Self {
+ ... | node-graph/libraries/vector-types/src/subpath/core.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add an arrow to the Shape tool | 3,343 | GraphiteEditor/Graphite | 17,935 | Rust | krVatsal | Review this pull request change.
Language: Rust
File: node-graph/libraries/vector-types/src/subpath/core.rs
PR Title: Add an arrow to the Shape tool
BEFORE CODE: let left = DVec2::new(corner1.x, center.y);
let right = DVec2::new(corner2.x, center.y);
// Based on https://pomax.github.io/bezierinfo/#circles_cu... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
}
pub fn set_transform(&mut self, transform: DAffine2, network_path: &[NodeId]) {
let Some(network_metadata) = self.network_metadata_mut(network_path) else {
log::error!("Could not get nested network in set_transform");
return;
};
network_metadata.persistent_metadata.navigation_metadata.node_graph_to... | No issues found. | }
}
pub fn set_transform(&mut self, transform: DAffine2, network_path: &[NodeId]) {
let Some(network_metadata) = self.network_metadata_mut(network_path) else {
log::error!("Could not get nested network in set_transform");
return;
};
network_metadata.persistent_metadata.navigation_metadata.node_graph_to... | @@ -1210,6 +1210,13 @@ impl NodeNetworkInterface {
.reduce(Quad::combine_bounds)
}
+ pub fn document_bounds_viewport_space(&self, include_artboards: bool) -> Option<[DVec2; 2]> {
+ let [min, max] = self.document_bounds_document_space(include_artboards)?;
+ let quad = Quad::from_box([min, max]);
+ let transfo... | editor/src/messages/portfolio/document/utility_types/network_interface.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Respect artboard clipping when computing canvas scrollbars | 3,387 | GraphiteEditor/Graphite | 17,935 | Rust | ashishmohapatra240 | Review this pull request change.
Language: Rust
File: editor/src/messages/portfolio/document/utility_types/network_interface.rs
PR Title: Respect artboard clipping when computing canvas scrollbars
BEFORE CODE: }
}
pub fn set_transform(&mut self, transform: DAffine2, network_path: &[NodeId]) {
let Some(networ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
width: Option<u32>,
height: Option<u32>,
transparent: bool,
) -> Result<(), Box<dyn Error>> {
// Determine export format based on file type
let export_format = match file_type {
FileType::Svg => ExportFormat::Svg,
_ => ExportFormat::Raster,
};
// Create render config with export settings
let mut render_con... | No issues found. | width: Option<u32>,
height: Option<u32>,
transparent: bool,
) -> Result<(), Box<dyn Error>> {
// Determine export format based on file type
let export_format = match file_type {
FileType::Svg => ExportFormat::Svg,
_ => ExportFormat::Raster,
};
// Create render config with export settings
let mut render_con... | @@ -0,0 +1,116 @@
+use graph_craft::document::value::{RenderOutputType, TaggedValue, UVec2};
+use graph_craft::graphene_compiler::Executor;
+use graphene_std::application_io::{ExportFormat, RenderConfig};
+use graphene_std::core_types::ops::Convert;
+use graphene_std::core_types::transform::Footprint;
+use graphene_std... | node-graph/graphene-cli/src/export.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add export command to Graphene CLI | 3,400 | GraphiteEditor/Graphite | 17,935 | Rust | TrueDoctor | Review this pull request change.
Language: Rust
File: node-graph/graphene-cli/src/export.rs
PR Title: Add export command to Graphene CLI
BEFORE CODE: width: Option<u32>,
height: Option<u32>,
transparent: bool,
) -> Result<(), Box<dyn Error>> {
// Determine export format based on file type
let export_format = m... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
NodeInput::Scope(_) => TypeSource::Compiled(concrete!(())),
NodeInput::Reflection(document_node_metadata) => TypeSource::Compiled(document_node_metadata.ty()),
NodeInput::Inline(_) => TypeSource::Compiled(concrete!(InlineRust)),
}
}
/// Get the [`TypeSource`] for any InputConnector.
/// If the input... | No issues found. | }
NodeInput::Scope(_) => TypeSource::Compiled(concrete!(())),
NodeInput::Reflection(document_node_metadata) => TypeSource::Compiled(document_node_metadata.ty()),
NodeInput::Inline(_) => TypeSource::Compiled(concrete!(InlineRust)),
}
}
/// Get the [`TypeSource`] for any InputConnector.
/// If the input... | @@ -2,7 +2,7 @@ use std::collections::{HashMap, HashSet};
use graph_craft::document::value::TaggedValue;
use graph_craft::document::{DocumentNodeImplementation, InlineRust, NodeInput};
-use graph_craft::proto::GraphErrors;
+use graph_craft::proto::{GraphErrorType, GraphErrors};
use graph_craft::{Type, concrete};
... | editor/src/messages/portfolio/document/utility_types/network_interface/resolved_types.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Use more specific node input indexing when displaying invalid input errors | 3,415 | GraphiteEditor/Graphite | 17,935 | Rust | adamgerhant | Review this pull request change.
Language: Rust
File: editor/src/messages/portfolio/document/utility_types/network_interface/resolved_types.rs
PR Title: Use more specific node input indexing when displaying invalid input errors
BEFORE CODE: }
NodeInput::Scope(_) => TypeSource::Compiled(concrete!(())),
Node... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
/// Generates the brush strokes painted with the Brush tool as a raster image.
/// If an input image is supplied, strokes are drawn on top of it, expanding bounds as needed.
#[node_macro::node(category("Raster"))]
async fn brush(
_: impl Ctx,
/// Optional raster content that may be drawn onto.
mut image: Table<Rast... | No issues found. |
/// Generates the brush strokes painted with the Brush tool as a raster image.
/// If an input image is supplied, strokes are drawn on top of it, expanding bounds as needed.
#[node_macro::node(category("Raster"))]
async fn brush(
_: impl Ctx,
/// Optional raster content that may be drawn onto.
mut image: Table<Rast... | @@ -57,6 +57,9 @@ impl<P: Pixel + Alpha> Sample for BrushStampGenerator<P> {
}
}
+/// Controls the brush shape with diameter and hardness, plus color and opacity (via flow).
+/// The feather exponent is calculated from hardness to determine edge softness.
+/// Used internally to create the brush texture before sta... | node-graph/nodes/brush/src/brush.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add tooltip documentation to web request and brush related nodes | 3,427 | GraphiteEditor/Graphite | 17,935 | Rust | PolyglotOpenstreetmap | Review this pull request change.
Language: Rust
File: node-graph/nodes/brush/src/brush.rs
PR Title: Add tooltip documentation to web request and brush related nodes
BEFORE CODE:
/// Generates the brush strokes painted with the Brush tool as a raster image.
/// If an input image is supplied, strokes are drawn on to... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
use crate::consts::{COLOR_OVERLAY_BLUE, LAYER_ORIGIN_CROSS_DIAMETER, LAYER_ORIGIN_CROSS_THICKNESS};
use crate::messages::portfolio::document::overlays::utility_types::OverlayContext;
use crate::messages::portfolio::document::utility_types::document_metadata::LayerNodeIdentifier;
use crate::messages::tool::tool_messages... | No issues found. | use crate::consts::{COLOR_OVERLAY_BLUE, LAYER_ORIGIN_CROSS_DIAMETER, LAYER_ORIGIN_CROSS_THICKNESS};
use crate::messages::portfolio::document::overlays::utility_types::OverlayContext;
use crate::messages::portfolio::document::utility_types::document_metadata::LayerNodeIdentifier;
use crate::messages::tool::tool_messages... | @@ -0,0 +1,46 @@
+use crate::consts::{COLOR_OVERLAY_BLUE, LAYER_ORIGIN_CROSS_DIAMETER, LAYER_ORIGIN_CROSS_THICKNESS};
+use crate::messages::portfolio::document::overlays::utility_types::OverlayContext;
+use crate::messages::portfolio::document::utility_types::document_metadata::LayerNodeIdentifier;
+use crate::messages... | editor/src/messages/tool/common_functionality/layer_origin_cross.rs | 0 | Rust | 1 | none | 16 | 47 | 47 | true | Add a Select tool overlay for the layer origin | 3,471 | GraphiteEditor/Graphite | 17,935 | Rust | 0HyperCube | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/common_functionality/layer_origin_cross.rs
PR Title: Add a Select tool overlay for the layer origin
BEFORE CODE: use crate::consts::{COLOR_OVERLAY_BLUE, LAYER_ORIGIN_CROSS_DIAMETER, LAYER_ORIGIN_CROSS_THICKNESS};
use crate::messages::por... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
*self
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FoundSubpath {
pub edges: Vec<HalfEdge>,
}
impl FoundSubpath {
pub fn new(segments: Vec<HalfEdge>) -> Self {
Self { edges: segments }
}
pub fn endpoints(&self) -> Option<(&HalfEdge, &HalfEdge)> {
match (self.edges.first(), self.edges.l... | No issues found. | *self
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FoundSubpath {
pub edges: Vec<HalfEdge>,
}
impl FoundSubpath {
pub fn new(segments: Vec<HalfEdge>) -> Self {
Self { edges: segments }
}
pub fn endpoints(&self) -> Option<(&HalfEdge, &HalfEdge)> {
match (self.edges.first(), self.edges.l... | @@ -1,7 +1,8 @@
use crate::subpath::{Bezier, BezierHandles, Identifier, ManipulatorGroup, Subpath};
-use crate::vector::misc::{HandleId, dvec2_to_point};
+use crate::vector::misc::{HandleId, Tangent, dvec2_to_point};
use crate::vector::vector_types::Vector;
use dyn_any::DynAny;
+use fixedbitset::FixedBitSet;
use gl... | node-graph/libraries/vector-types/src/vector/vector_attributes.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Implement proper fill rendering for vector meshes | 3,474 | GraphiteEditor/Graphite | 17,935 | Rust | liunicholas6 | Review this pull request change.
Language: Rust
File: node-graph/libraries/vector-types/src/vector/vector_attributes.rs
PR Title: Implement proper fill rendering for vector meshes
BEFORE CODE: *self
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FoundSubpath {
pub edges: Vec<HalfEdge>,
}
imp... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
}
}
let gradient_state = if dragging {
GradientToolFsmState::Drawing
} else {
let selected_layer = document.click(input, viewport);
// Apply the gradient to the selected layer
if let Some(layer) = selected_layer {
// Add check for raster layer
if NodeGraphLayer... | No issues found. | }
}
}
let gradient_state = if dragging {
GradientToolFsmState::Drawing
} else {
let selected_layer = document.click(input, viewport);
// Apply the gradient to the selected layer
if let Some(layer) = selected_layer {
// Add check for raster layer
if NodeGraphLayer... | @@ -63,17 +63,48 @@ impl<'a> MessageHandler<ToolMessage, &mut ToolActionMessageContext<'a>> for Grad
match options {
GradientOptionsUpdate::Type(gradient_type) => {
self.options.gradient_type = gradient_type;
- // Update the selected gradient if it exists
+ let selected_layers: Vec<_> = context
+ ... | editor/src/messages/tool/tool_messages/gradient_tool.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Fix the Gradient tool's linear/radial type toggle resetting the gradient color stops | 3,499 | GraphiteEditor/Graphite | 17,935 | Rust | Annonnymmousss | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/tool_messages/gradient_tool.rs
PR Title: Fix the Gradient tool's linear/radial type toggle resetting the gradient color stops
BEFORE CODE: }
}
}
let gradient_state = if dragging {
GradientToolFsmState::Drawing
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
#[inline(always)]
pub fn maximum_rgb_channels(&self) -> f32 {
self.red.max(self.green).max(self.blue)
}
// From https://stackoverflow.com/a/56678483/775283
#[inline(always)]
pub fn luminance_srgb(&self) -> f32 {
0.2126 * self.red + 0.7152 * self.green + 0.0722 * self.blue
}
// From https://en.wikipedia.or... | No issues found. | #[inline(always)]
pub fn maximum_rgb_channels(&self) -> f32 {
self.red.max(self.green).max(self.blue)
}
// From https://stackoverflow.com/a/56678483/775283
#[inline(always)]
pub fn luminance_srgb(&self) -> f32 {
0.2126 * self.red + 0.7152 * self.green + 0.0722 * self.blue
}
// From https://en.wikipedia.or... | @@ -216,7 +216,7 @@ impl Pixel for Luma {}
/// The other components (RGB) are stored as `f32` that range from `0.0` up to `f32::MAX`,
/// the values encode the brightness of each channel proportional to the light intensity in cd/m² (nits) in HDR, and `0.0` (black) to `1.0` (white) in SDR color.
#[repr(C)]
-#[derive(... | node-graph/libraries/no-std-types/src/color/color_types.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Fix rasterize node document leakage with hashmap and eq check | 3,550 | GraphiteEditor/Graphite | 17,935 | Rust | Ayush2k02 | Review this pull request change.
Language: Rust
File: node-graph/libraries/no-std-types/src/color/color_types.rs
PR Title: Fix rasterize node document leakage with hashmap and eq check
BEFORE CODE: #[inline(always)]
pub fn maximum_rgb_channels(&self) -> f32 {
self.red.max(self.green).max(self.blue)
}
// From... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
let import_name = format_ident!("_IMPORT_STUB_{}", mod_name.to_string().to_case(Case::UpperSnake));
let properties = &attributes.properties_string.as_ref().map(|value| quote!(Some(#value))).unwrap_or(quote!(None));
let cfg = crate::shader_nodes::modify_cfg(attributes);
let node_input_accessor = generate_node_inpu... | No issues found. | let import_name = format_ident!("_IMPORT_STUB_{}", mod_name.to_string().to_case(Case::UpperSnake));
let properties = &attributes.properties_string.as_ref().map(|value| quote!(Some(#value))).unwrap_or(quote!(None));
let cfg = crate::shader_nodes::modify_cfg(attributes);
let node_input_accessor = generate_node_inpu... | @@ -37,33 +37,102 @@ pub(crate) fn generate_node_code(crate_ident: &CrateIdent, parsed: &ParsedNodeFn
};
let struct_name = format_ident!("{}Node", struct_name);
- let struct_generics: Vec<Ident> = fields.iter().enumerate().map(|(i, _)| format_ident!("Node{}", i)).collect();
+ // Separate data fields from regular ... | node-graph/node-macro/src/codegen.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Migrate memo nodes to node macro and make implementing other persistent nodes easier | 3,552 | GraphiteEditor/Graphite | 17,935 | Rust | TrueDoctor | Review this pull request change.
Language: Rust
File: node-graph/node-macro/src/codegen.rs
PR Title: Migrate memo nodes to node macro and make implementing other persistent nodes easier
BEFORE CODE: let import_name = format_ident!("_IMPORT_STUB_{}", mod_name.to_string().to_case(Case::UpperSnake));
let properties... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
pub mod generator_nodes;
pub mod instance;
pub mod merge_qr_squares;
pub mod vector_modification_nodes;
mod vector_nodes;
#[macro_use]
extern crate log;
// Re-export for convenience
pub use core_types as gcore;
pub use generator_nodes::*;
pub use graphic_types;
pub use instance::*;
pub use vector_modification_nodes::... | No issues found. | pub mod generator_nodes;
pub mod instance;
pub mod merge_qr_squares;
pub mod vector_modification_nodes;
mod vector_nodes;
#[macro_use]
extern crate log;
// Re-export for convenience
pub use core_types as gcore;
pub use generator_nodes::*;
pub use graphic_types;
pub use instance::*;
pub use vector_modification_nodes::... | @@ -1,5 +1,6 @@
pub mod generator_nodes;
pub mod instance;
+pub mod merge_qr_squares;
pub mod vector_modification_nodes;
mod vector_nodes;
| node-graph/nodes/vector/src/lib.rs | 0 | Rust | 1 | none | 16 | 18 | 18 | true | Introduce QR Code node | 3,565 | GraphiteEditor/Graphite | 17,935 | Rust | Sahil-Gupta584 | Review this pull request change.
Language: Rust
File: node-graph/nodes/vector/src/lib.rs
PR Title: Introduce QR Code node
BEFORE CODE: pub mod generator_nodes;
pub mod instance;
pub mod merge_qr_squares;
pub mod vector_modification_nodes;
mod vector_nodes;
#[macro_use]
extern crate log;
// Re-export for convenien... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
advertise_actions! {ExportDialogUpdate;}
}
impl DialogLayoutHolder for ExportDialogMessageHandler {
const ICON: &'static str = "File";
const TITLE: &'static str = "Export";
fn layout_buttons(&self) -> Layout {
let widgets = vec![
TextButton::new("Export")
.emphasized(true)
.on_update(|_| {
Dial... | No issues found. |
advertise_actions! {ExportDialogUpdate;}
}
impl DialogLayoutHolder for ExportDialogMessageHandler {
const ICON: &'static str = "File";
const TITLE: &'static str = "Export";
fn layout_buttons(&self) -> Layout {
let widgets = vec![
TextButton::new("Export")
.emphasized(true)
.on_update(|_| {
Dial... | @@ -43,13 +43,21 @@ impl MessageHandler<ExportDialogMessage, ExportDialogMessageContext<'_>> for Exp
ExportDialogMessage::TransparentBackground { transparent } => self.transparent_background = transparent,
ExportDialogMessage::ExportBounds { bounds } => self.bounds = bounds,
- ExportDialogMessage::Submit =>... | editor/src/messages/dialog/export_dialog/export_dialog_message_handler.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add artboard name to the export when exporting a single artboard | 3,613 | GraphiteEditor/Graphite | 17,935 | Rust | Ayush2k02 | Review this pull request change.
Language: Rust
File: editor/src/messages/dialog/export_dialog/export_dialog_message_handler.rs
PR Title: Add artboard name to the export when exporting a single artboard
BEFORE CODE:
advertise_actions! {ExportDialogUpdate;}
}
impl DialogLayoutHolder for ExportDialogMessageHandler... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
mod handle_desktop_wrapper_message;
mod intercept_editor_message;
mod intercept_frontend_message;
pub(crate) mod utils;
pub struct DesktopWrapper {
editor: Editor,
}
impl DesktopWrapper {
pub fn new(uuid_random_seed: u64) -> Self {
#[cfg(target_os = "windows")]
let host = Host::Windows;
#[cfg(target_os = "ma... | No issues found. | mod handle_desktop_wrapper_message;
mod intercept_editor_message;
mod intercept_frontend_message;
pub(crate) mod utils;
pub struct DesktopWrapper {
editor: Editor,
}
impl DesktopWrapper {
pub fn new(uuid_random_seed: u64) -> Self {
#[cfg(target_os = "windows")]
let host = Host::Windows;
#[cfg(target_os = "ma... | @@ -6,6 +6,7 @@ pub use graphite_editor::consts::FILE_EXTENSION;
// TODO: Remove usage of this reexport in desktop create and remove this line
pub use graphene_std::Color;
+pub use wgpu_executor::TargetTexture;
pub use wgpu_executor::WgpuContext;
pub use wgpu_executor::WgpuContextBuilder;
pub use wgpu_executor::... | desktop/wrapper/src/lib.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Fix GPU out-of-memory crash by reusing overlay textures | 3,614 | GraphiteEditor/Graphite | 17,935 | Rust | afrdbaig7 | Review this pull request change.
Language: Rust
File: desktop/wrapper/src/lib.rs
PR Title: Fix GPU out-of-memory crash by reusing overlay textures
BEFORE CODE: mod handle_desktop_wrapper_message;
mod intercept_editor_message;
mod intercept_frontend_message;
pub(crate) mod utils;
pub struct DesktopWrapper {
edito... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
// Implementation macro to avoid code duplication
($input:expr; $($modifier:ident),*; $($refresh:ident),*; $action_dispatch:expr; $canonical:expr; $disabled:expr) => {
&[&[
// Cause the `action_dispatch` message to be sent when the specified input occurs.
MappingEntry {
action: $action_dispatch.into(),
... | No issues found. |
// Implementation macro to avoid code duplication
($input:expr; $($modifier:ident),*; $($refresh:ident),*; $action_dispatch:expr; $canonical:expr; $disabled:expr) => {
&[&[
// Cause the `action_dispatch` message to be sent when the specified input occurs.
MappingEntry {
action: $action_dispatch.into(),
... | @@ -25,51 +25,82 @@ macro_rules! modifiers {
/// When an action is currently available, and the user enters that input, the action's message is dispatched on the message bus.
macro_rules! entry {
// Pattern with canonical parameter
- ($input:expr_2021; $(modifiers=[$($modifier:ident),*],)? $(refresh_keys=[$($refres... | editor/src/messages/input_mapper/utility_types/macros.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Desktop: Add fullscreen window mode | 3,625 | GraphiteEditor/Graphite | 17,935 | Rust | timon-schelling | Review this pull request change.
Language: Rust
File: editor/src/messages/input_mapper/utility_types/macros.rs
PR Title: Desktop: Add fullscreen window mode
BEFORE CODE:
// Implementation macro to avoid code duplication
($input:expr; $($modifier:ident),*; $($refresh:ident),*; $action_dispatch:expr; $canonical:ex... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
#[derive(Default)]
pub struct Arrow;
impl Arrow {
pub fn create_node(document: &DocumentMessageHandler, drag_start: DVec2, shaft_width: f64, head_width: f64, head_length: f64) -> NodeTemplate {
let node_type = resolve_proto_node_type(graphene_std::vector_nodes::arrow::IDENTIFIER).expect("Arrow node does not exist"... | No issues found. |
#[derive(Default)]
pub struct Arrow;
impl Arrow {
pub fn create_node(document: &DocumentMessageHandler, drag_start: DVec2, shaft_width: f64, head_width: f64, head_length: f64) -> NodeTemplate {
let node_type = resolve_proto_node_type(graphene_std::vector_nodes::arrow::IDENTIFIER).expect("Arrow node does not exist"... | @@ -15,16 +15,16 @@ use std::collections::VecDeque;
pub struct Arrow;
impl Arrow {
- pub fn create_node(document: &DocumentMessageHandler, drag_start: DVec2) -> NodeTemplate {
+ pub fn create_node(document: &DocumentMessageHandler, drag_start: DVec2, shaft_width: f64, head_width: f64, head_length: f64) -> NodeTempl... | editor/src/messages/tool/common_functionality/shapes/arrow_shape.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Improve the Shape tool's arrow drawing controls | 3,650 | GraphiteEditor/Graphite | 17,935 | Rust | krVatsal | Review this pull request change.
Language: Rust
File: editor/src/messages/tool/common_functionality/shapes/arrow_shape.rs
PR Title: Improve the Shape tool's arrow drawing controls
BEFORE CODE:
#[derive(Default)]
pub struct Arrow;
impl Arrow {
pub fn create_node(document: &DocumentMessageHandler, drag_start: DVec... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
pub fn handle_message<T: Into<Message>>(&mut self, message: T) -> Vec<FrontendMessage> {
self.dispatcher.handle_message(message, true);
std::mem::take(&mut self.dispatcher.responses)
}
pub fn poll_node_graph_evaluation(&mut self, responses: &mut VecDeque<Message>) -> Result<(), String> {
self.dispatcher.... | No issues found. | }
pub fn handle_message<T: Into<Message>>(&mut self, message: T) -> Vec<FrontendMessage> {
self.dispatcher.handle_message(message, true);
std::mem::take(&mut self.dispatcher.responses)
}
pub fn poll_node_graph_evaluation(&mut self, responses: &mut VecDeque<Message>) -> Result<(), String> {
self.dispatcher.... | @@ -1,24 +1,31 @@
use crate::dispatcher::Dispatcher;
use crate::messages::prelude::*;
pub use graphene_std::uuid::*;
+use std::sync::OnceLock;
-// TODO: serialize with serde to save the current editor state
pub struct Editor {
pub dispatcher: Dispatcher,
}
impl Editor {
- /// Construct the editor.
- /// Rem... | editor/src/application.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Replace globals with editor environment | 3,656 | GraphiteEditor/Graphite | 17,935 | Rust | timon-schelling | Review this pull request change.
Language: Rust
File: editor/src/application.rs
PR Title: Replace globals with editor environment
BEFORE CODE: }
pub fn handle_message<T: Into<Message>>(&mut self, message: T) -> Vec<FrontendMessage> {
self.dispatcher.handle_message(message, true);
std::mem::take(&mut self.di... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
let message = DesktopWrapperMessage::LoadDocument {
id,
document,
to_front: false,
select_after_open: false,
};
responses.push(message);
}
if let Some(id) = self.persistent_data.current_document_id() {
let message = DesktopWrapperMessage::SelectDocument { id };
r... | No issues found. | let message = DesktopWrapperMessage::LoadDocument {
id,
document,
to_front: false,
select_after_open: false,
};
responses.push(message);
}
if let Some(id) = self.persistent_data.current_document_id() {
let message = DesktopWrapperMessage::SelectDocument { id };
r... | @@ -1,17 +1,17 @@
use rand::Rng;
use rfd::AsyncFileDialog;
use std::fs;
-use std::path::PathBuf;
use std::sync::mpsc::{Receiver, Sender, SyncSender};
use std::thread;
use std::time::{Duration, Instant};
use winit::application::ApplicationHandler;
use winit::dpi::{PhysicalPosition, PhysicalSize};
use winit::eve... | desktop/src/app.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Desktop: Restart without UI acceleration when it fails on Linux | 3,668 | GraphiteEditor/Graphite | 17,935 | Rust | timon-schelling | Review this pull request change.
Language: Rust
File: desktop/src/app.rs
PR Title: Desktop: Restart without UI acceleration when it fails on Linux
BEFORE CODE: let message = DesktopWrapperMessage::LoadDocument {
id,
document,
to_front: false,
select_after_open: false,
};
respo... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
responses.add(DocumentMessage::DeselectAllLayers);
responses.add(DocumentMessage::AddTransaction);
added_nodes = true;
}
document.load_layer_resources(responses, &self.persistent_data.font_catalog);
let new_ids: HashMap<_, _> = entry.nodes.iter().map(|(id, _)| (*id, NodeId:... | No issues found. | responses.add(DocumentMessage::DeselectAllLayers);
responses.add(DocumentMessage::AddTransaction);
added_nodes = true;
}
document.load_layer_resources(responses, &self.persistent_data.font_catalog);
let new_ids: HashMap<_, _> = entry.nodes.iter().map(|(id, _)| (*id, NodeId:... | @@ -60,11 +60,12 @@ pub struct PortfolioMessageHandler {
pub executor: NodeGraphExecutor,
pub selection_mode: SelectionMode,
pub reset_node_definitions_on_open: bool,
- pub data_panel_open: bool,
- #[derivative(Default(value = "true"))]
- pub layers_panel_open: bool,
+ pub focus_document: bool,
#[derivative(Def... | editor/src/messages/portfolio/portfolio_message_handler.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add focus document toggle | 3,672 | GraphiteEditor/Graphite | 17,935 | Rust | timon-schelling | Review this pull request change.
Language: Rust
File: editor/src/messages/portfolio/portfolio_message_handler.rs
PR Title: Add focus document toggle
BEFORE CODE: responses.add(DocumentMessage::DeselectAllLayers);
responses.add(DocumentMessage::AddTransaction);
added_nodes = true;
}
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
RenderIntermediate {
ty: RenderIntermediateType::Svg(Arc::new((render.svg.to_svg_string(), render.image_data, render.svg_defs.clone()))),
metadata,
contains_artboard,
}
}
}
}
#[node_macro::node(category(""))]
async fn create_context<'a: 'n>(
// Context injections are defined in the wrap_network_... | No issues found. |
RenderIntermediate {
ty: RenderIntermediateType::Svg(Arc::new((render.svg.to_svg_string(), render.image_data, render.svg_defs.clone()))),
metadata,
contains_artboard,
}
}
}
}
#[node_macro::node(category(""))]
async fn create_context<'a: 'n>(
// Context injections are defined in the wrap_network_... | @@ -189,10 +189,11 @@ async fn render<'a: 'n>(ctx: impl Ctx + ExtractFootprint + ExtractVarArgs, edito
}
}
- let mut background = Color::from_rgb8_srgb(0x22, 0x22, 0x22);
- if !contains_artboard && !render_params.hide_artboards {
- background = Color::WHITE;
- }
+ let background = if !render_param... | node-graph/nodes/gstd/src/render_node.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Desktop: Fix bitmap file export not preserving alpha | 3,673 | GraphiteEditor/Graphite | 17,935 | Rust | timon-schelling | Review this pull request change.
Language: Rust
File: node-graph/nodes/gstd/src/render_node.rs
PR Title: Desktop: Fix bitmap file export not preserving alpha
BEFORE CODE:
RenderIntermediate {
ty: RenderIntermediateType::Svg(Arc::new((render.svg.to_svg_string(), render.image_data, render.svg_defs.clone()))),... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
}
visited.insert(*id);
}
true
}
/// Sort the nodes vec so it is in a topological order. This ensures that no node takes an input from a node that is found later in the list.
fn reorder_ids(&mut self) -> Result<(), String> {
let (order, _id_map) = self.topological_sort()?;
// // Map of node ids ... | No issues found. | }
}
visited.insert(*id);
}
true
}
/// Sort the nodes vec so it is in a topological order. This ensures that no node takes an input from a node that is found later in the list.
fn reorder_ids(&mut self) -> Result<(), String> {
let (order, _id_map) = self.topological_sort()?;
// // Map of node ids ... | @@ -794,7 +794,14 @@ impl TypingContext {
.into_iter()
.chain(&inputs)
.enumerate()
- .filter_map(|(i, t)| if i == 0 { None } else { Some(format!("• Input {}: {t}", i + convert_node_index_offset)) })
+ .filter_map(|(i, t)| {
+ if i == 0 {
+ None
+ } else {
+ let number = ... | node-graph/graph-craft/src/proto.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Fix regression breaking Into/Convert node type coercion | 3,681 | GraphiteEditor/Graphite | 17,935 | Rust | Keavon | Review this pull request change.
Language: Rust
File: node-graph/graph-craft/src/proto.rs
PR Title: Fix regression breaking Into/Convert node type coercion
BEFORE CODE: }
}
visited.insert(*id);
}
true
}
/// Sort the nodes vec so it is in a topological order. This ensures that no node takes an input... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
};
updatePixelRatio();
// Update rendered SVGs
editor.subscriptions.subscribeJsMessage(UpdateDocumentArtwork, async (data) => {
await tick();
updateDocumentArtwork(data.svg);
});
editor.subscriptions.subscribeJsMessage(UpdateEyedropperSamplingState, async (data) => {
await tick();
const { ima... | No issues found. | };
updatePixelRatio();
// Update rendered SVGs
editor.subscriptions.subscribeJsMessage(UpdateDocumentArtwork, async (data) => {
await tick();
updateDocumentArtwork(data.svg);
});
editor.subscriptions.subscribeJsMessage(UpdateEyedropperSamplingState, async (data) => {
await tick();
const { ima... | @@ -212,7 +212,13 @@
});
}
- export async function updateEyedropperSamplingState(mousePosition: XY | undefined, colorPrimary: string, colorSecondary: string): Promise<[number, number, number] | undefined> {
+ export async function updateEyedropperSamplingState(
+ // `image` is currently only used for Vello rend... | frontend/src/components/panels/Document.svelte | 0 | Svelte | 1 | none | 16 | 51 | 51 | true | Desktop: Add Eyedropper tool support with native Vello | 3,684 | GraphiteEditor/Graphite | 17,935 | Rust | timon-schelling | Review this pull request change.
Language: Svelte
File: frontend/src/components/panels/Document.svelte
PR Title: Desktop: Add Eyedropper tool support with native Vello
BEFORE CODE: };
updatePixelRatio();
// Update rendered SVGs
editor.subscriptions.subscribeJsMessage(UpdateDocumentArtwork, async (data) => ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
self.editor.dispatcher.message_handlers.portfolio_message_handler.active_document_mut().unwrap()
}
pub fn get_node<'a, T: InputAccessor<'a, DocumentNode>>(&'a self) -> impl Iterator<Item = T> + 'a {
self.active_document()
.network_interface
.document_network()
.recursive_nodes()
.inspect(|(_, node, _... | No issues found. | self.editor.dispatcher.message_handlers.portfolio_message_handler.active_document_mut().unwrap()
}
pub fn get_node<'a, T: InputAccessor<'a, DocumentNode>>(&'a self) -> impl Iterator<Item = T> + 'a {
self.active_document()
.network_interface
.document_network()
.recursive_nodes()
.inspect(|(_, node, _... | @@ -210,6 +210,18 @@ impl EditorTestUtils {
.await;
}
+ pub async fn left_mouseup(&mut self, x: f64, y: f64, modifier_keys: ModifierKeys) {
+ self.mouseup(
+ EditorMouseState {
+ editor_position: (x, y).into(),
+ mouse_keys: MouseKeys::empty(),
+ scroll_delta: ScrollDelta::default(),
+ },
+ modif... | editor/src/test_utils.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Improve the Gradient tool by visualizing color stops | 3,698 | GraphiteEditor/Graphite | 17,935 | Rust | jsjgdh | Review this pull request change.
Language: Rust
File: editor/src/test_utils.rs
PR Title: Improve the Gradient tool by visualizing color stops
BEFORE CODE: self.editor.dispatcher.message_handlers.portfolio_message_handler.active_document_mut().unwrap()
}
pub fn get_node<'a, T: InputAccessor<'a, DocumentNode>>(&... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
impl RenderExt for Fill {
type Output = String;
/// Renders the fill, adding necessary defs through mutating the first argument.
fn render(&self, svg_defs: &mut String, element_transform: DAffine2, stroke_transform: DAffine2, bounds: DAffine2, transformed_bounds: DAffine2, render_params: &RenderParams) -> Self::Ou... | No issues found. |
impl RenderExt for Fill {
type Output = String;
/// Renders the fill, adding necessary defs through mutating the first argument.
fn render(&self, svg_defs: &mut String, element_transform: DAffine2, stroke_transform: DAffine2, bounds: DAffine2, transformed_bounds: DAffine2, render_params: &RenderParams) -> Self::Ou... | @@ -1,5 +1,5 @@
-use crate::renderer::{RenderParams, format_transform_matrix};
-use core_types::consts::{LAYER_OUTLINE_STROKE_COLOR, LAYER_OUTLINE_STROKE_WEIGHT};
+use crate::renderer::{RenderParams, black_or_white_for_best_contrast, format_transform_matrix};
+use core_types::consts::LAYER_OUTLINE_STROKE_WEIGHT;
use c... | node-graph/libraries/rendering/src/render_ext.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Fix outline rendering mode to draw shapes as black or white based on contrast with their artboard's color | 3,724 | GraphiteEditor/Graphite | 17,935 | Rust | jsjgdh | Review this pull request change.
Language: Rust
File: node-graph/libraries/rendering/src/render_ext.rs
PR Title: Fix outline rendering mode to draw shapes as black or white based on contrast with their artboard's color
BEFORE CODE:
impl RenderExt for Fill {
type Output = String;
/// Renders the fill, adding nec... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AlignmentSnapSource {
BoundingBoxCornerPoint,
BoundingBoxCenterPoint,
BoundingBoxEdgeMidpoint,
ArtboardCornerPoint,
ArtboardCenterPoint,
}
impl fmt::Display for AlignmentSnapSource {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {... | No issues found. | }
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AlignmentSnapSource {
BoundingBoxCornerPoint,
BoundingBoxCenterPoint,
BoundingBoxEdgeMidpoint,
ArtboardCornerPoint,
ArtboardCenterPoint,
}
impl fmt::Display for AlignmentSnapSource {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {... | @@ -307,6 +307,19 @@ pub enum PathSnapSource {
IntersectionPoint,
}
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum GradientSnapSource {
+ Endpoint,
+}
+
+impl fmt::Display for GradientSnapSource {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ match self {
+ GradientSnapSource::Endpoint... | editor/src/messages/portfolio/document/utility_types/misc.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Add snapping to endpoints and stops in the Gradient tool | 3,732 | GraphiteEditor/Graphite | 17,935 | Rust | jsjgdh | Review this pull request change.
Language: Rust
File: editor/src/messages/portfolio/document/utility_types/misc.rs
PR Title: Add snapping to endpoints and stops in the Gradient tool
BEFORE CODE: }
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AlignmentSnapSource {
BoundingBoxCornerPoint,
BoundingBoxCente... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
}
}
self.select_if_not_dragged = None;
}
// End of reordering an import
else if let (Some(moving_import), Some(end_index)) = (self.reordering_import, self.end_index) {
responses.add(NodeGraphMessage::ReorderImport {
start_index: moving_import,
end_index,
});
... | No issues found. | }
}
}
self.select_if_not_dragged = None;
}
// End of reordering an import
else if let (Some(moving_import), Some(end_index)) = (self.reordering_import, self.end_index) {
responses.add(NodeGraphMessage::ReorderImport {
start_index: moving_import,
end_index,
});
... | @@ -1977,16 +1977,8 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
}
if control {
- let mut non_layer_nodes = HashSet::new();
-
- let layer_nodes = nodes.iter().filter(|node_id| network_interface.is_layer(node_id, selection_network_path));
- for &layer_i... | editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs | 0 | Rust | 1 | none | 16 | 51 | 51 | true | Fix holding Ctrl in the graph not allowing for selecting nodes unless some are in a layer | 3,778 | GraphiteEditor/Graphite | 17,935 | Rust | jsjgdh | Review this pull request change.
Language: Rust
File: editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs
PR Title: Fix holding Ctrl in the graph not allowing for selecting nodes unless some are in a layer
BEFORE CODE: }
}
}
self.select_if_not_dragged = None;
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
const validRegionPattern = new RE2("^[a-z0-9-]+$");
if (typeof region !== "string" || region.length === 0 || region.length > 20) {
return false;
}
return validRegionPattern.test(region);
}
export const identityAwsAuthServiceFactory = ({
identityAccessTokenDAL,
identityAwsAuthDAL,
identityOrgMembersh... | isn't this going to make that any request with `headers.Authorization` have a null value? also if `headers.authorization` is true, the condition is checking first `headers.Authorization`, is this intended? | const validRegionPattern = new RE2("^[a-z0-9-]+$");
if (typeof region !== "string" || region.length === 0 || region.length > 20) {
return false;
}
return validRegionPattern.test(region);
}
export const identityAwsAuthServiceFactory = ({
identityAccessTokenDAL,
identityAwsAuthDAL,
identityOrgMembersh... | @@ -94,7 +94,7 @@ export const identityAwsAuthServiceFactory = ({
const headers: TAwsGetCallerIdentityHeaders = JSON.parse(Buffer.from(iamRequestHeaders, "base64").toString());
const body: string = Buffer.from(iamRequestBody, "base64").toString();
- const region = headers.Authorization ? awsRegionFromHea... | backend/src/services/identity-aws-auth/identity-aws-auth-service.ts | 26 | TypeScript | 0.714 | security | 205 | 51 | 51 | false | docs(identities/aws-auth): eks pod auth | 3,762 | Infisical/infisical | 22,351 | TypeScript | carlosmonastyrski | varonix0 | Review this pull request change.
Language: TypeScript
File: backend/src/services/identity-aws-auth/identity-aws-auth-service.ts
PR Title: docs(identities/aws-auth): eks pod auth
BEFORE CODE: const validRegionPattern = new RE2("^[a-z0-9-]+$");
if (typeof region !== "string" || region.length === 0 || region.lengt... | isn't this going to make that any request with `headers.Authorization` have a null value? also if `headers.authorization` is true, the condition is checking first `headers.Authorization`, is this intended? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
groupSearchFilter:
"The template used when constructing the group membership query such as `(&(objectClass=posixGroup)(memberUid={{.Username}}))`. The template can access the following context variables: `[UserDN, UserName]`. The default is `(|(memberUid={{.Username}})(member={{.UserDN}})(uniqueMember={{.User... | ```suggestion
projectId: "The ID of the project the subscription belongs to.",
``` | searchFilter:
"The template used to construct the LDAP user search filter such as `(uid={{username}})` uses literal `{{username}}` to have the given username used in the search. The default is `(uid={{username}})` which is compatible with several common directory schemas.",
groupSearchBase: "LDAP search b... | @@ -2869,3 +2870,10 @@ export const LdapSso = {
caCert: "The CA certificate to use when verifying the LDAP server certificate."
}
};
+
+export const EventSubscriptions = {
+ SUBSCRIBE_PROJECT_EVENTS: {
+ projectId: "The ID of the project the group belongs to.", | backend/src/lib/api-docs/constants.ts | 26 | TypeScript | 0.571 | suggestion | 88 | 30 | 33 | false | Events system docs | 4,294 | Infisical/infisical | 22,351 | TypeScript | sidwebworks | sidwebworks | Review this pull request change.
Language: TypeScript
File: backend/src/lib/api-docs/constants.ts
PR Title: Events system docs
BEFORE CODE: groupSearchFilter:
"The template used when constructing the group membership query such as `(&(objectClass=posixGroup)(memberUid={{.Username}}))`. The template can ac... | ```suggestion
projectId: "The ID of the project the subscription belongs to.",
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
caCert
}: TCreateLdapCfgDTO) => {
const { permission } = await permissionService.getOrgPermission(actor, actorId, orgId, actorAuthMethod, actorOrgId);
ForbiddenError.from(permission).throwUnlessCan(OrgPermissionActions.Create, OrgPermissionSubjects.Ldap);
const plan = await licenseService.getPlan(org... | Can we say something like "Failed to establish connection to LDAP directory. Please verify that your credentials are correct" | caCert
}: TCreateLdapCfgDTO) => {
const { permission } = await permissionService.getOrgPermission(actor, actorId, orgId, actorAuthMethod, actorOrgId);
ForbiddenError.from(permission).throwUnlessCan(OrgPermissionActions.Create, OrgPermissionSubjects.Ldap);
const plan = await licenseService.getPlan(org... | @@ -131,6 +132,19 @@ export const ldapConfigServiceFactory = ({
orgId
});
+ const isConnected = await testLDAPConfig({
+ bindDN,
+ bindPass,
+ caCert,
+ url
+ });
+
+ if (!isConnected) {
+ throw new BadRequestError({
+ message: "Failed to create LDAP configuration ... | backend/src/ee/services/ldap-config/ldap-config-service.ts | 26 | TypeScript | 0.357 | bug | 125 | 51 | 51 | false | misc: address LDAP config update and test issues | 4,329 | Infisical/infisical | 22,351 | TypeScript | varonix0 | sheensantoscapadngan | Review this pull request change.
Language: TypeScript
File: backend/src/ee/services/ldap-config/ldap-config-service.ts
PR Title: misc: address LDAP config update and test issues
BEFORE CODE: caCert
}: TCreateLdapCfgDTO) => {
const { permission } = await permissionService.getOrgPermission(actor, actorId, o... | Can we say something like "Failed to establish connection to LDAP directory. Please verify that your credentials are correct" | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
email: user.email,
username: user.username,
isEmailVerified: user.isEmailVerified
})),
`Verify email users: [username=${username}]`
);
const user =
usersByusername?.length > 1 ? usersByusername.find((el) => el.username === username) : usersByusername?.[0];
if (!use... | Actually same suggestion: Instead of bulk let's do it directly. If alias is in token let's do
userAliasDAL.updateById(aliasId, {})
| id: user.id,
email: user.email,
username: user.username,
isEmailVerified: user.isEmailVerified
})),
`Verify email users: [username=${username}]`
);
const user =
usersByusername?.length > 1 ? usersByusername.find((el) => el.username === username) : usersByuserna... | @@ -106,6 +126,8 @@ export const userServiceFactory = ({
const userEmails = user?.email ? await userDAL.find({ email: user.email }) : [];
+ await userAliasDAL.update({ userId: user.id }, { isEmailVerified: true }); | backend/src/services/user/user-service.ts | 26 | TypeScript | 0.429 | suggestion | 133 | 51 | 51 | false | Fix SAML duplicate accounts when signing in the first time on an existing account | 4,344 | Infisical/infisical | 22,351 | TypeScript | akhilmhdh | carlosmonastyrski | Review this pull request change.
Language: TypeScript
File: backend/src/services/user/user-service.ts
PR Title: Fix SAML duplicate accounts when signing in the first time on an existing account
BEFORE CODE: email: user.email,
username: user.username,
isEmailVerified: user.isEmailVerified
... | Actually same suggestion: Instead of bulk let's do it directly. If alias is in token let's do
userAliasDAL.updateById(aliasId, {})
| You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
export const userServiceFactory = ({
userDAL,
orgMembershipDAL,
projectMembershipDAL,
groupProjectDAL,
tokenService,
smtpService,
permissionService,
userAliasDAL
}: TUserServiceFactoryDep) => {
const sendEmailVerificationCode = async (referer: string) => {
const url = new URL(referer);
const r... | Small correction: If alias id provided in token and userAlias not found throw an error as well | export const userServiceFactory = ({
userDAL,
orgMembershipDAL,
projectMembershipDAL,
groupProjectDAL,
tokenService,
smtpService,
permissionService,
userAliasDAL
}: TUserServiceFactoryDep) => {
const sendEmailVerificationCode = async (token: string) => {
const { authType, aliasId, username, authTo... | @@ -48,17 +51,32 @@ export const userServiceFactory = ({
groupProjectDAL,
tokenService,
smtpService,
- permissionService
+ permissionService,
+ userAliasDAL
}: TUserServiceFactoryDep) => {
- const sendEmailVerificationCode = async (username: string) => {
+ const sendEmailVerificationCode = async (referer... | backend/src/services/user/user-service.ts | 26 | TypeScript | 0.429 | suggestion | 94 | 51 | 51 | false | Fix SAML duplicate accounts when signing in the first time on an existing account | 4,344 | Infisical/infisical | 22,351 | TypeScript | akhilmhdh | carlosmonastyrski | Review this pull request change.
Language: TypeScript
File: backend/src/services/user/user-service.ts
PR Title: Fix SAML duplicate accounts when signing in the first time on an existing account
BEFORE CODE: export const userServiceFactory = ({
userDAL,
orgMembershipDAL,
projectMembershipDAL,
groupProjectDAL... | Small correction: If alias id provided in token and userAlias not found throw an error as well | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
});
};
const verifyEmailVerificationCode = async (username: string, code: string) => {
// akhilmhdh: case sensitive email resolution
const usersByusername = await userDAL.findUserByUsername(username);
logger.info(
usersByusername.map((user) => ({
id: user.id,
email: u... | I would recommend instead of this - is alias check verification for that else user isEmailVerified one | code: userToken
}
});
};
const verifyEmailVerificationCode = async (username: string, code: string) => {
// akhilmhdh: case sensitive email resolution
const usersByusername = await userDAL.findUserByUsername(username);
logger.info(
usersByusername.map((user) => ({
id: u... | @@ -95,7 +113,9 @@ export const userServiceFactory = ({
if (!user) throw new NotFoundError({ name: `User with username '${username}' not found` });
if (!user.email)
throw new BadRequestError({ name: "Failed to verify email verification code due to no email on user" });
- if (user.isEmailVerified)
+
... | backend/src/services/user/user-service.ts | 26 | TypeScript | 0.429 | suggestion | 102 | 51 | 51 | false | Fix SAML duplicate accounts when signing in the first time on an existing account | 4,344 | Infisical/infisical | 22,351 | TypeScript | akhilmhdh | carlosmonastyrski | Review this pull request change.
Language: TypeScript
File: backend/src/services/user/user-service.ts
PR Title: Fix SAML duplicate accounts when signing in the first time on an existing account
BEFORE CODE: }
});
};
const verifyEmailVerificationCode = async (username: string, code: string) => {
/... | I would recommend instead of this - is alias check verification for that else user isEmailVerified one | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.