mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-04 05:18:19 +00:00
Change number inputs to be f32 instead of f64 for most nodes (#1543)
This commit is contained in:
parent
d268afb7fb
commit
6bfb2bf344
6 changed files with 28 additions and 18 deletions
|
@ -15,7 +15,7 @@ pub struct TextGeneratorNode<Text, FontName, Size> {
|
|||
}
|
||||
|
||||
#[node_fn(TextGeneratorNode)]
|
||||
fn generate_text<'a: 'input, T>(editor: EditorApi<'a, T>, text: String, font_name: Font, font_size: f64) -> crate::vector::VectorData {
|
||||
fn generate_text<'a: 'input, T>(editor: EditorApi<'a, T>, text: String, font_name: Font, font_size: f32) -> crate::vector::VectorData {
|
||||
let buzz_face = editor.font_cache.get(&font_name).map(|data| load_face(data));
|
||||
crate::vector::VectorData::from_subpaths(to_path(&text, buzz_face, font_size, None))
|
||||
crate::vector::VectorData::from_subpaths(to_path(&text, buzz_face, font_size as f64, None))
|
||||
}
|
||||
|
|
|
@ -212,7 +212,11 @@ pub struct ResamplePoints<Spacing, StartOffset, StopOffset, AdaptiveSpacing> {
|
|||
}
|
||||
|
||||
#[node_macro::node_fn(ResamplePoints)]
|
||||
fn resample_points(mut vector_data: VectorData, spacing: f64, start_offset: f64, stop_offset: f64, adaptive_spacing: bool) -> VectorData {
|
||||
fn resample_points(mut vector_data: VectorData, spacing: f32, start_offset: f32, stop_offset: f32, adaptive_spacing: bool) -> VectorData {
|
||||
let spacing = spacing as f64;
|
||||
let start_offset = start_offset as f64;
|
||||
let stop_offset = stop_offset as f64;
|
||||
|
||||
for subpath in &mut vector_data.subpaths {
|
||||
if subpath.is_empty() || spacing.is_zero() || !spacing.is_finite() {
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue