Commit 125a3cc
CSS margin
Changed files (2)
Diff
@@ -53,8 +53,6 @@ public class Gradient : GLib.Object { g.href = href; transforms = transforms.copy (); - print (@"$(this)\n");- return g; } @@ -284,6 +284,8 @@ public class SvgStyle : GLib.Object { if (k == "padding") { parse_padding_shorthand (v);+ } else if (k == "margin") {+ parse_margin_shorthand (v); } else { style.set (k, v); }@@ -291,6 +293,26 @@ public class SvgStyle : GLib.Object { } } + void parse_margin_shorthand (string arguments) {+ string[] args = StyleSheet.replace_whitespace (arguments).split (" ");+ + if (args.length > 0) {+ style.set ("margin-top", args[0]);+ }+ + if (args.length > 1) {+ style.set ("margin-right", args[1]);+ }++ if (args.length > 2) {+ style.set ("margin-bottom", args[2]);+ }++ if (args.length > 3) {+ style.set ("margin-left", args[3]);+ }+ }+ void parse_padding_shorthand (string arguments) { string[] args = StyleSheet.replace_whitespace (arguments).split (" ");