Skip to content

Commit ba1ead9

Browse files
committed
Move 10 to a constant
1 parent b675e40 commit ba1ead9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

editor/src/consts.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,6 @@ pub const DOUBLE_CLICK_MILLISECONDS: u64 = 500;
186186
pub const UI_SCALE_DEFAULT: f64 = 1.;
187187
pub const UI_SCALE_MIN: f64 = 0.5;
188188
pub const UI_SCALE_MAX: f64 = 3.;
189+
190+
// ACTIONS
191+
pub const BLEND_SHAPE_COUNT_PER_LAYER: usize = 10;

editor/src/messages/portfolio/document/document_message_handler.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ use super::utility_types::network_interface::{self, NodeNetworkInterface, Transa
55
use super::utility_types::nodes::{CollapsedLayers, LayerStructureEntry, SelectedNodes};
66
use crate::application::{GRAPHITE_GIT_COMMIT_HASH, generate_uuid};
77
use crate::consts::{
8-
ASYMPTOTIC_EFFECT, COLOR_OVERLAY_GRAY, DEFAULT_DOCUMENT_NAME, FILE_EXTENSION, LAYER_INDENT_OFFSET, NODE_CHAIN_WIDTH, SCALE_EFFECT, SCROLLBAR_SPACING, VIEWPORT_ROTATE_SNAP_INTERVAL,
8+
ASYMPTOTIC_EFFECT, BLEND_SHAPE_COUNT_PER_LAYER, COLOR_OVERLAY_GRAY, DEFAULT_DOCUMENT_NAME, FILE_EXTENSION, LAYER_INDENT_OFFSET, NODE_CHAIN_WIDTH, SCALE_EFFECT, SCROLLBAR_SPACING,
9+
VIEWPORT_ROTATE_SNAP_INTERVAL,
910
};
1011
use crate::messages::input_mapper::utility_types::macros::action_shortcut;
1112
use crate::messages::layout::utility_types::widget_prelude::*;
@@ -1972,7 +1973,7 @@ impl DocumentMessageHandler {
19721973
GroupFolderType::BlendShapes | GroupFolderType::Morph => {
19731974
let control_path_id = NodeId(generate_uuid());
19741975
let all_layers_to_group = network_interface.shallowest_unique_layers_sorted(&[]);
1975-
let blend_count = matches!(group_folder_type, GroupFolderType::BlendShapes).then(|| all_layers_to_group.len() * 10);
1976+
let blend_count = matches!(group_folder_type, GroupFolderType::BlendShapes).then(|| all_layers_to_group.len() * BLEND_SHAPE_COUNT_PER_LAYER);
19761977

19771978
responses.add(GraphOperationMessage::NewInterpolationLayer {
19781979
id: folder_id,

0 commit comments

Comments
 (0)