forked from 1b-agent/opencadstudio-upstream
Merge pull request #1549 from MarcelP102/codex/graphic-attributes-cleanup
[UX] Introducing graphic attributes panel # Conflicts: # locales/ar-SA/opencadstudio.ftl # locales/bg-BG/opencadstudio.ftl # locales/cs-CZ/opencadstudio.ftl # locales/de-DE/opencadstudio.ftl # locales/el-GR/opencadstudio.ftl # locales/en-US/opencadstudio.ftl # locales/es-ES/opencadstudio.ftl # locales/fi-FI/opencadstudio.ftl # locales/fr-FR/opencadstudio.ftl # locales/hi-IN/opencadstudio.ftl # locales/hu-HU/opencadstudio.ftl # locales/it-IT/opencadstudio.ftl # locales/ja-JP/opencadstudio.ftl # locales/ko-KR/opencadstudio.ftl # locales/lo-LA/opencadstudio.ftl # locales/nl-NL/opencadstudio.ftl # locales/pl-PL/opencadstudio.ftl # locales/pt-BR/opencadstudio.ftl # locales/ru-RU/opencadstudio.ftl # locales/tr-TR/opencadstudio.ftl # locales/zh-CN/opencadstudio.ftl # locales/zh-TW/opencadstudio.ftl # src/app/mod.rs # src/app/update/dialog.rs # src/app/view/mod.rs # src/locale_catalog.rs # src/ui/dock.rs
This commit is contained in:
commit
1333efcad2
68 files changed
+6178
-173
No files matched your search
+8
-6
@@ -103,7 +103,7 @@ fn family_from_stored_line(
|
||||
|
||||
/// Preserve the selected hue while moving its HSL lightness towards the
|
||||
/// persisted one-colour tint/shade target (0 = black, 1 = white).
|
||||
fn gradient_tint_color(base: [f32; 4], target: f32) -> [f32; 4] {
|
||||
pub(crate) fn gradient_tint_color(base: [f32; 4], target: f32) -> [f32; 4] {
|
||||
let max = base[0].max(base[1]).max(base[2]);
|
||||
let min = base[0].min(base[1]).min(base[2]);
|
||||
let lightness = (max + min) * 0.5;
|
||||
@@ -1394,10 +1394,12 @@ impl Scene {
|
||||
style.0 = crate::scene::view::render::adapt_to_bg(style.0, hatch_bg);
|
||||
m.aci = style.4;
|
||||
m.line_weight_px = style.3;
|
||||
// A gradient's colour is its first stop (already baked into
|
||||
// the cached model); only solid / pattern fills take the
|
||||
// entity's resolved colour.
|
||||
if !matches!(m.pattern, model::hatch_model::HatchPattern::Gradient { .. }) {
|
||||
// Gradient RGB comes from its own colour stops, while
|
||||
// transparency remains an entity property shared by both
|
||||
// stops. Solid/pattern fills take the complete style.
|
||||
if matches!(m.pattern, model::hatch_model::HatchPattern::Gradient { .. }) {
|
||||
m.set_alpha(style.0[3]);
|
||||
} else {
|
||||
m.color = style.0;
|
||||
}
|
||||
if let EntityType::Hatch(dxf) = e {
|
||||
@@ -2213,7 +2215,7 @@ impl Scene {
|
||||
.colors
|
||||
.get(i)
|
||||
.and_then(|e| e.color.rgb())
|
||||
.map(|(r, g, b)| [r as f32 / 255.0, g as f32 / 255.0, b as f32 / 255.0, 1.0])
|
||||
.map(|(r, g, b)| [r as f32 / 255.0, g as f32 / 255.0, b as f32 / 255.0, color[3]])
|
||||
};
|
||||
gradient_color1 = stop(0);
|
||||
let color1 = gradient_color1.unwrap_or(color);
|
||||
|
||||
Reference in new issue
Block a user