🔧 Support alpha values for snap color
This commit is contained in:
@@ -84,7 +84,7 @@
|
||||
<property name="width-request">300</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="snap-scale">
|
||||
<property name="upper">5</property>
|
||||
<property name="upper">20</property>
|
||||
<property name="lower">0.1</property>
|
||||
<property name="step-increment">0.01</property>
|
||||
<property name="page-increment">0.1</property>
|
||||
@@ -122,7 +122,7 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="snap-color">
|
||||
<property name="use_alpha">0</property>
|
||||
<property name="use_alpha">1</property>
|
||||
<property name="show_editor">1</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
@@ -444,7 +444,7 @@
|
||||
</key>
|
||||
|
||||
<key name="snap-scale" type="d">
|
||||
<default>2.0</default>
|
||||
<default>3.0</default>
|
||||
<summary>Snap Scale</summary>
|
||||
<description>The size of the snap effect.</description>
|
||||
</key>
|
||||
|
||||
@@ -153,9 +153,8 @@ if (utils.isInShellProcess()) {
|
||||
const float WIND_INTENSITY = 0.05;
|
||||
const float ACTOR_SCALE = 1.2;
|
||||
const float PADDING = ACTOR_SCALE / 2.0 - 0.5;
|
||||
const vec3 DUST_COLOR = vec3(${color.red / 255},
|
||||
${color.green / 255},
|
||||
${color.blue / 255});
|
||||
const vec4 DUST_COLOR = vec4(${color.red / 255}, ${color.green / 255},
|
||||
${color.blue / 255}, ${color.alpha / 255});
|
||||
void main() {
|
||||
|
||||
// We simply inverse the progress for opening windows.
|
||||
@@ -212,7 +211,8 @@ if (utils.isInShellProcess()) {
|
||||
|
||||
// Fade the window color to DUST_COLOR.
|
||||
vec4 windowColor = texture2D(uTexture, coords + 0.5);
|
||||
windowColor.rgb = mix(windowColor.rgb, DUST_COLOR*windowColor.a, progress);
|
||||
vec3 dustColor = mix(windowColor.rgb, DUST_COLOR.rgb, DUST_COLOR.a);
|
||||
windowColor.rgb = mix(windowColor.rgb, dustColor*windowColor.a, progress);
|
||||
|
||||
// Dissolve the dust particles.
|
||||
float dissolve = (dustMap.x - progress) > 0 ? 1 : 0;
|
||||
|
||||
Reference in New Issue
Block a user