mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-30 18:14:00 +01:00
Honor template and layout destinations, preserve the active layout mode, and update the template library after a successful write. Keep Log copy and selection, rotated fill feedback, and image-view restoration consistent with the visible session. Refresh lighting when an imported environment changes or disappears. Share image resampling by resolution, skip unused headless uploads, bound tile conversion batches, and avoid cloning trace scenes per row slice. Keep the new display and shortcut types in dedicated files.
34 lines
1.0 KiB
Rust
34 lines
1.0 KiB
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
/// What the environment is fixed to (Display settings > Environment Alignment)
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Default)]
|
|
pub enum EnvAlignment {
|
|
/// The environment stays with the scene: orbiting the camera looks around it
|
|
#[default]
|
|
World,
|
|
/// The environment turns with the camera (about the vertical axis): the lighting stays the same while orbiting
|
|
Camera,
|
|
}
|
|
|
|
impl EnvAlignment {
|
|
pub const ALL: [EnvAlignment; 2] = [EnvAlignment::World, EnvAlignment::Camera];
|
|
|
|
pub fn label(self) -> &'static str {
|
|
match self {
|
|
EnvAlignment::World => "World",
|
|
EnvAlignment::Camera => "Camera",
|
|
}
|
|
}
|
|
|
|
pub fn id(self) -> &'static str {
|
|
match self {
|
|
EnvAlignment::World => "world",
|
|
EnvAlignment::Camera => "camera",
|
|
}
|
|
}
|
|
|
|
pub fn parse(id: &str) -> Option<EnvAlignment> {
|
|
Self::ALL.into_iter().find(|alignment| alignment.id().eq_ignore_ascii_case(id))
|
|
}
|
|
}
|