Skip to content

Commit 305d717

Browse files
authored
Merge branch 'master' into love_0_11_0
2 parents dec9498 + 87dc4c9 commit 305d717

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

gooi/button.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ function gooi.newButton(params)
1717
params.h or theH * 2,
1818
"button"
1919
)
20-
20+
21+
local yLocal = params.yLocal or 0
22+
2123
b = component.new("button", x, y, w, h, params.group)
2224
b = gooi.setStyleComp(b)
2325
b.text = params.text or defaultText
@@ -77,7 +79,10 @@ function gooi.newButton(params)
7779
math.floor(self.icon:getHeight() / 2))
7880
end
7981
love.graphics.setColor(fg)
80-
local yLine = self.y + self.h / 2
82+
83+
84+
85+
local yLine = yLocal + self.y + self.h / 2
8186
yLine = yLine - (gooi.getFont(self):getHeight()) * #self.textParts / 2
8287
for i = 1, #self.textParts do
8388
local part = self.textParts[i]

gooi/component.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ function component:draw()-- Every component has the same base:
306306
end
307307

308308
if self.bgImage then
309+
309310
love.graphics.setColor(1, 1, 1)
310311
love.graphics.draw(self.bgImage,
311312
math.floor(self.x),
@@ -320,6 +321,7 @@ function component:draw()-- Every component has the same base:
320321
if style.showBorder then
321322
love.graphics.setColor(newColor)
322323
if not self.enabled then
324+
323325
love.graphics.setColor(1/4, 1/4, 1/4)
324326
end
325327
love.graphics.rectangle("line",
@@ -347,7 +349,6 @@ function component:drawShadowPressed()
347349
50)
348350
end, "replace", 1)
349351
love.graphics.setStencilTest("greater", 0)
350-
351352
love.graphics.setColor(1, 1, 1)
352353
love.graphics.draw(self.imgShadow,
353354
self.x + self.w / 2,

gooi/gooi.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ end
337337

338338
-- Draw the stuff:
339339
function gooi.draw(group)
340+
love.graphics.origin() --to take in account scale,translate,rotate
340341
local actualGroup = group or "default"
341342

342343
local prevFont = love.graphics.getFont()

gooi/label.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ function gooi.newLabel(params)
6868
local xImg = math.floor(self.x + self.h / 2)
6969
love.graphics.setColor(1, 1, 1)
7070
if not self.enabled then love.graphics.setColor(1/4, 1/4, 1/4) end
71-
7271
if t:len() == 0 then
7372
xImg = math.floor(self.x + self.w / 2)
7473
end

0 commit comments

Comments
 (0)