Return type of field of property instead of property.
This commit is contained in:
@@ -16,10 +16,10 @@ pub const Transform = struct {
|
||||
opacity: f32 = 1.0,
|
||||
|
||||
pub fn init(obj: *const Document.Object) Transform {
|
||||
const pos = if (obj.getProperty(.position)) |p| p.position else Point2_f{ .x = 0, .y = 0 };
|
||||
const angle = if (obj.getProperty(.angle)) |p| p.angle else 0;
|
||||
const scale = if (obj.getProperty(.scale)) |p| p.scale else Scale2_f{ .scale_x = 1, .scale_y = 1 };
|
||||
const opacity = if (obj.getProperty(.opacity)) |p| p.opacity else 1.0;
|
||||
const pos = obj.getProperty(.position) orelse Point2_f{ .x = 0, .y = 0 };
|
||||
const angle = obj.getProperty(.angle) orelse 0;
|
||||
const scale = obj.getProperty(.scale) orelse Scale2_f{ .scale_x = 1, .scale_y = 1 };
|
||||
const opacity = obj.getProperty(.opacity) orelse 1.0;
|
||||
return .{
|
||||
.position = pos,
|
||||
.angle = angle,
|
||||
|
||||
Reference in New Issue
Block a user