add proper support on rotateCmd for lang.Command.Rotate
This commit is contained in:
parent
54919110a5
commit
b0525f2386
1 changed files with 8 additions and 11 deletions
|
@ -190,16 +190,14 @@ pub const Runner = struct {
|
|||
_ = try proc.spawnAndWait();
|
||||
}
|
||||
|
||||
fn rotateCmd(
|
||||
self: *Runner,
|
||||
deg: f32,
|
||||
bgfill: []const u8,
|
||||
) !void {
|
||||
fn rotateCmd(self: *Runner, cmd: lang.Command) !void {
|
||||
const rotate_cmd = cmd.cast(lang.Command.Rotate).?;
|
||||
|
||||
var image = try self.getImage();
|
||||
var c_bgfill = try std.cstr.addNullByte(self.allocator, bgfill);
|
||||
var c_bgfill = try std.cstr.addNullByte(self.allocator, rotate_cmd.bgfill);
|
||||
defer self.allocator.free(c_bgfill);
|
||||
|
||||
try magick.runRotate(image, deg, c_bgfill);
|
||||
try magick.runRotate(image, rotate_cmd.deg, c_bgfill);
|
||||
}
|
||||
|
||||
fn executeLV2Command(self: *@This(), command: var) !void {
|
||||
|
@ -263,11 +261,10 @@ pub const Runner = struct {
|
|||
const command = cmd.cast(lang.Command.Load).?;
|
||||
try self.loadCmd(command.path);
|
||||
},
|
||||
.quicksave => {
|
||||
try self.quicksaveCmd();
|
||||
},
|
||||
.amp => try self.runSingleCommand(cmd, .amp),
|
||||
.quicksave => try self.quicksaveCmd(),
|
||||
.rotate => try self.rotateCmd(cmd),
|
||||
|
||||
.amp => try self.runSingleCommand(cmd, .amp),
|
||||
.rflanger => try self.runSingleCommand(cmd, .rflanger),
|
||||
.eq => try self.runSingleCommand(cmd, .eq),
|
||||
.phaser => try self.runSingleCommand(cmd, .phaser),
|
||||
|
|
Loading…
Reference in a new issue