Skip to content

Conversation

@Firestar99
Copy link
Collaborator

Requires #2760

Split out from #2746 (comment)

@Firestar99 Firestar99 changed the base branch from master to gsvg_renderer June 27, 2025 10:35
@Firestar99 Firestar99 force-pushed the extract_math_nodes branch from 4c4f210 to 2d5894f Compare June 27, 2025 10:59
@Firestar99 Firestar99 marked this pull request as draft June 27, 2025 11:07
@Firestar99 Firestar99 force-pushed the extract_math_nodes branch from 2d5894f to 55e09b7 Compare June 27, 2025 11:45
@Firestar99 Firestar99 marked this pull request as ready for review June 27, 2025 11:45
@Firestar99 Firestar99 changed the title Extract math nodes Extract gmath_nodes from gcore::ops, create mods debug and extract_xy Jun 27, 2025
@Firestar99 Firestar99 force-pushed the extract_math_nodes branch from 55e09b7 to 5eaa7d9 Compare June 27, 2025 11:56
@Firestar99 Firestar99 force-pushed the gsvg_renderer branch 2 times, most recently from 20c7be5 to bb01fd9 Compare June 27, 2025 13:39
@Firestar99 Firestar99 force-pushed the extract_math_nodes branch from 5eaa7d9 to 4d4977e Compare June 27, 2025 13:40
Base automatically changed from gsvg_renderer to master June 27, 2025 13:47
Comment on lines +393 to +416
/// The logical or operation (||) returns true if either of the two inputs are true, or false if both are false.
#[node_macro::node(category("Math: Logic"))]
fn logical_or(_: impl Ctx, value: bool, other_value: bool) -> bool {
value || other_value
}

/// The logical and operation (&&) returns true if both of the two inputs are true, or false if any are false.
#[node_macro::node(category("Math: Logic"))]
fn logical_and(_: impl Ctx, value: bool, other_value: bool) -> bool {
value && other_value
}

/// The logical not operation (!) reverses true and false value of the input.
#[node_macro::node(category("Math: Logic"))]
fn logical_not(_: impl Ctx, input: bool) -> bool {
!input
}

/// Constructs a bool value which may be set to true or false.
#[node_macro::node(category("Value"))]
fn bool_value(_: impl Ctx, _primary: (), #[name("Bool")] bool_value: bool) -> bool {
bool_value
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if it would make more sense to move these to the logic mod now that the mod is no longer called ops

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can split up the lib into smaller mods, though I'd create a new logic op and not put it into the old, since the old is almost exclusively string manipulation except for SwitchNode (which I may move here)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, just wanted to make you aware of this, we can always move things later once we are a bit more settled into the new structure

@Firestar99 Firestar99 force-pushed the extract_math_nodes branch from 4d4977e to f3629ab Compare June 27, 2025 19:37
@Firestar99 Firestar99 merged commit ecd7999 into master Jun 27, 2025
4 checks passed
@Firestar99 Firestar99 deleted the extract_math_nodes branch June 27, 2025 22:04
urisinger pushed a commit to urisinger/Graphite that referenced this pull request Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants