Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solid model opacity is reset to 1 when changing colour #457

Closed
nabijaczleweli opened this issue Aug 10, 2019 · 1 comment
Closed

Solid model opacity is reset to 1 when changing colour #457

nabijaczleweli opened this issue Aug 10, 2019 · 1 comment
Labels
Milestone

Comments

@nabijaczleweli
Copy link
Contributor

nabijaczleweli commented Aug 10, 2019

System information

SolveSpace version: 3.0~d9081b0b

Operating system: Windows 10

Expected behavior

The opacity of a solid model is preserved when changing the RGB value.

Actual behavior

It's reset to 1.

Additional information

The following patch addresses the issue:

diff --git a/src/textscreens.cpp b/src/textscreens.cpp
index 999001a..5c17491 100644
--- a/src/textscreens.cpp
+++ b/src/textscreens.cpp
@@ -752,7 +752,9 @@ void TextWindow::EditControlDone(std::string s) {
 
                 Group *g = SK.group.FindByIdNoOops(SS.TW.shown.group);
                 if(!g) break;
+                auto alpha = g->color.alpha;
                 g->color = RGBf(rgb.x, rgb.y, rgb.z);
+                g->color.alpha = alpha;
 
                 SS.MarkGroupDirty(g->h);
                 SS.GW.ClearSuper();
@whitequark whitequark added this to the 3.0 milestone Aug 12, 2019
@whitequark whitequark added the bug label Aug 12, 2019
@whitequark
Copy link
Contributor

Fixed in 97c8cb7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants