diff options
author | Damiano Galassi <[email protected]> | 2020-11-21 09:58:38 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2020-11-21 09:58:38 +0100 |
commit | e73d9e45d93b3de3509b6e6865a4bdc3e0d6f89e (patch) | |
tree | c0e29d7f444b0919235c189a802e5b1bb0b3a94e /macosx | |
parent | 3d4e5ce2e46078df0a9a5b07ecae0f0162c14271 (diff) |
MacGui: fix pad filter when used together with the rotate filter.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/HBJob+HBJobConversion.m | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/macosx/HBJob+HBJobConversion.m b/macosx/HBJob+HBJobConversion.m index 1536fc904..8138caebd 100644 --- a/macosx/HBJob+HBJobConversion.m +++ b/macosx/HBJob+HBJobConversion.m @@ -559,12 +559,36 @@ color = self.picture.paddingColorCustom; break; } + int width, height, paddingLeft, paddingTop; + switch (self.picture.rotate) { + case 90: + width = self.picture.height + self.picture.paddingTop + self.picture.paddingBottom; + height = self.picture.width + self.picture.paddingLeft + self.picture.paddingRight; + paddingLeft = self.picture.paddingBottom; + paddingTop = self.picture.paddingLeft; + break; + case 180: + width = self.picture.width + self.picture.paddingLeft + self.picture.paddingRight; + height = self.picture.height + self.picture.paddingTop + self.picture.paddingBottom; + paddingLeft = self.picture.paddingRight; + paddingTop = self.picture.paddingBottom; + break; + case 270: + width = self.picture.height + self.picture.paddingTop + self.picture.paddingBottom; + height = self.picture.width + self.picture.paddingLeft + self.picture.paddingRight; + paddingLeft = self.picture.paddingTop; + paddingTop = self.picture.paddingRight; + break; + case 0: + default: + width = self.picture.width + self.picture.paddingLeft + self.picture.paddingRight; + height = self.picture.height + self.picture.paddingTop + self.picture.paddingBottom; + paddingLeft = self.picture.paddingLeft; + paddingTop = self.picture.paddingTop; + break; + } NSString *settings = [NSString stringWithFormat:@"width=%d:height=%d:color=%@:x=%d:y=%d", - self.picture.width + self.picture.paddingLeft + self.picture.paddingRight, - self.picture.height + self.picture.paddingTop + self.picture.paddingBottom, - color, - self.picture.paddingLeft, - self.picture.paddingTop]; + width, height, color, paddingLeft, paddingTop]; hb_dict_t *filter_dict = hb_generate_filter_settings(filter_id, NULL, NULL, settings.UTF8String); filter = hb_filter_init(filter_id); |