Closed eksperts closed 6 years ago
The forum thread Global values not fully working with Margins posted by mircea@code11.com was linked to this issue.
Uh, that global is a float4
, not a float
. So I'm not convinced this is what the user wanted.
oh. slipped my attention, let me test that.
Actually, looks like this is due to difference in behavior between ux expressions and explicit values. The rules for how to implicitly convert is different between these two, I think.
Yeah, changing the global to float
doesn't help, the issue is the same.
I think that should work though. Adjusting original ticket to reflect this.
@eksperts: Yeah, I think I agree. This should have worked.
This seems to fix it:
diff --git a/Source/Fuse.Marshal/Marshal.Cast.uno b/Source/Fuse.Marshal/Marshal.Cast.uno
index 15e4d58..4673868 100644
--- a/Source/Fuse.Marshal/Marshal.Cast.uno
+++ b/Source/Fuse.Marshal/Marshal.Cast.uno
@@ -102,7 +102,18 @@ namespace Fuse
var y = a.Length > 1 ? ToFloat(a[1]) : 0.0f;
var z = a.Length > 2 ? ToFloat(a[2]) : 0.0f;
var w = a.Length > 3 ? ToFloat(a[3]) : 1.0f;
- return float4(x,y,z,w);
+ switch (a.Length)
+ {
+ case 0: return default(float4);
+
+ // let's just write down the conversion rules once
+ case 1: return ToFloat4(x);
+ case 2: return ToFloat4(float2(x, y));
+ case 3: return ToFloat4(float3(x, y, z));
+
+ default:
+ return float4(x,y,z,w);
+ }
}
double d;
@@ -286,4 +297,4 @@ namespace Fuse
return new Size(v, unit);
}
}
-}
\ No newline at end of file
+}
Reported on community.
Repro:
The second image should have the same margin on both left and right sides (
SP * 2
), and on top and bottom (SP * 3
). However, it's missing the right and bottom margin.Same applies for
Padding
. Otherfloat4
properties with a repeating pattern support (CornerRadius
?) should be checked too, but currently there are no reports on them being broken.