[READ-ONLY] Mirror of https://github.com/thoda-dev/svg-lua. svg lua library
0

Configure Feed

Select the types of activity you want to include in your feed.

added transform option for alla elements

Thomas DAGES (Dec 7, 2018, 11:36 AM +0100) 3bda4a17 4b29fff7

+19 -10
+7 -4
README.md
··· 69 69 * `fill: self.fill` svg:create() parameter ("transparent" by default) 70 70 - tranform: string => transformation options (eg: rotation) 71 71 72 - **svg:Rect(x, y, width, height, stroke, strokeWidth, fill, rx, ry)** *add a rectangle* 72 + **svg:Rect(x, y, width, height, stroke, strokeWidth, fill, rx, ry, transform)** *add a rectangle* 73 73 74 74 - x: number => Horizontal position from top left corner, default to 10 75 75 - y: number => Vertical position from top left corner, default to 10 ··· 80 80 - fill: string => fill color, default to svg:create() parameter ("transparent" by default) 81 81 - rx: number => Horizontal raduis of the corners, default to 0 82 82 - ry: number => Vertical radius of the corners, default to 0 83 + - tranform: string => transformation options (eg: rotation) 83 84 84 - **svg:Circle(r, cx, cy, stroke, strokeWidth, fill)** *add a circle* 85 + **svg:Circle(r, cx, cy, stroke, strokeWidth, fill, transform)** *add a circle* 85 86 86 87 - r: number => circle radius, default to 25 87 88 - cx: number => Horizontal position of the center, default to 30 ··· 89 90 - stroke: string => lines color, default to svg:create() parameter ("#000000" by default) 90 91 - strokeWidth: string => lines width, default to 1 91 92 - fill: string => fill color, default to svg:create() parameter ("transparent" by default) 93 + - tranform: string => transformation options (eg: rotation) 92 94 93 - **svg:Ellipse(cx, cy, rx, ry, stroke, strokeWidth, fill)** *add an ellipse* 95 + **svg:Ellipse(cx, cy, rx, ry, stroke, strokeWidth, fill, transform)** *add an ellipse* 94 96 95 97 - cx: number => Horizontal position of the center, default to 30 96 98 - cy: number => Vertical position of the center, default to 30 ··· 98 100 - ry: number => Vertical radius of the ellipse, default to 15 99 101 - stroke: string => lines color, default to svg:create() parameter ("#000000" by default) 100 102 - strokeWidth: string => lines width, default to 1 101 - - fill: string => fill color, default to svg:create() parameter ("transparent" by default) 103 + - fill: string => fill color, default to svg:create() parameter ("transparent" by default) 104 + - tranform: string => transformation options (eg: rotation)
+12 -6
svg.lua
··· 85 85 -- fill: string => fill color 86 86 -- rx: number => Rayon x des coins du rectangle 87 87 -- ry: number => Rayon y des coins du rectangle 88 - function svg:Rect(x, y, width, height, stroke, strokeWidth, fill, rx, ry) 88 + -- tranform: string => transformation options (eg: rotation) 89 + function svg:Rect(x, y, width, height, stroke, strokeWidth, fill, rx, ry, transform) 89 90 return self.Element:create("rect", { 90 91 x = x or 10, 91 92 y = y or 10, ··· 95 96 fill = fill or self.fill, 96 97 ["stroke-width"] = strokeWidth or 1, 97 98 rx = rx or 0, 98 - ry = ry or 0 99 + ry = ry or 0, 100 + transform = transform or "" 99 101 }) 100 102 end 101 103 ··· 106 108 -- stroke: string => lines color 107 109 -- strokeWidth: string => lines width 108 110 -- fill: string => fill color 109 - function svg:Circle(r, cx, cy, stroke, strokeWidth, fill) 111 + -- tranform: string => transformation options (eg: rotation) 112 + function svg:Circle(r, cx, cy, stroke, strokeWidth, fill, transform) 110 113 return self.Element:create("circle", { 111 114 r = r or 25, 112 115 cx = cx or 30, 113 116 cy = cy or 30, 114 117 stroke = stroke or self.stroke, 115 118 ["stroke-width"] = strokeWidth or 1, 116 - fill = fill or self.fill 119 + fill = fill or self.fill, 120 + transform = transform or "" 117 121 }) 118 122 end 119 123 ··· 125 129 -- stroke: string => lines color 126 130 -- strokeWidth: string => lines width 127 131 -- fill: string => fill color 128 - function svg:Ellipse(cx, cy, rx, ry, stroke, strokeWidth, fill) 132 + -- tranform: string => transformation options (eg: rotation) 133 + function svg:Ellipse(cx, cy, rx, ry, stroke, strokeWidth, fill, transform) 129 134 return self.Element:create("ellipse", { 130 135 rx = r or 25, 131 136 ry = r or 15, ··· 133 138 cy = cy or 30, 134 139 stroke = stroke or self.stroke, 135 140 ["stroke-width"] = strokeWidth or 1, 136 - fill = fill or self.fill 141 + fill = fill or self.fill, 142 + transform = transform or "" 137 143 }) 138 144 end