Skip to content

Commit

Permalink
Circle checkbox was not drawn correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tourahi committed Dec 17, 2023
1 parent b1a1f23 commit eda96f5
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 747 deletions.
23 changes: 15 additions & 8 deletions Controls/CheckBox.moon
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ drawRect = =>
r, g, b, a = Graphics.getColor!
boxW, boxH = box\getWidth!, box\getHeight!

colorBk = @backColor
colorBk = @strokeColor
local colorfr

if @checked
colorfr = @pressedColor
else
colorfr = @frontColor

Graphics.setLineStyle @borderLineStyle
Graphics.setColor colorBk
Graphics.rectangle "fill", box.x, box.y, boxW, boxH, @rx, @ry
Graphics.setColor colorfr
Expand All @@ -51,25 +52,30 @@ drawCircle = =>
r, g, b, a = Graphics.getColor!
boxR = box\getRadius!

colorBk = @backColor
Graphics.setLineStyle @borderLineStyle

colorBk = @strokeColor
local colorfr

if @checked
colorfr = @pressedColor
else
colorfr = @frontColor

Graphics.setColor colorBk
Graphics.circle 'fill', box.x, box.y, boxR, @segments
Graphics.setColor colorfr
Graphics.circle 'fill', box.x, box.y, ceil(boxR - @margin), @segments
Graphics.circle 'fill', box.x, box.y, boxR

Graphics.setLineWidth @stroke
Graphics.setColor colorBk
Graphics.circle 'line', box.x, box.y, boxR

Graphics.setColor r, g, b, a

-- @local
polyBorder = (box) =>
oldLineWidth = Graphics.getLineWidth!
Graphics.setLineWidth @stroke
Graphics.setLineStyle "rough"
Graphics.setLineStyle @borderLineStyle
Graphics.setColor @strokeColor
Graphics.polygon "line", box\getVertices!
Graphics.setLineWidth oldLineWidth
Expand Down Expand Up @@ -113,9 +119,10 @@ class CheckBox extends Control

@backColor = colors.downColor
@frontColor = colors.upColor
@pressedColor = colors.strokeColor
@pressedColor = t.checkBox.pressedColor
@disabledColor = colors.disabledColor
@strokeColor = {0, 0, 0}
@strokeColor = t.checkBox.borderLineColor
@borderLineStyle = t.checkBox.borderLineStyle
@alpha = 1
@reverseGroup = false
@checked = false
Expand Down
Binary file added Controls/assets/Iosevka-Bold.ttc
Binary file not shown.
Binary file removed Controls/assets/SAIBA-45-Outline.ttf
Binary file not shown.
Binary file removed Controls/assets/SAIBA-45.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Controls/assets/fonts/saiba/Fonts/SAIBA-45.eot
Binary file not shown.
Binary file removed Controls/assets/fonts/saiba/Fonts/SAIBA-45.otf
Binary file not shown.
Binary file removed Controls/assets/fonts/saiba/Fonts/SAIBA-45.ttf
Binary file not shown.
Binary file removed Controls/assets/fonts/saiba/Fonts/SAIBA-45.woff
Binary file not shown.
674 changes: 0 additions & 674 deletions Controls/assets/fonts/saiba/LICENSE

This file was deleted.

64 changes: 0 additions & 64 deletions Controls/assets/fonts/saiba/README.md

This file was deleted.

5 changes: 4 additions & 1 deletion Controls/themes/blues.moon
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ Default =
height: 25
rx: 2
ry: 2
margin: 4
margin: 3
radius: 20
segments: 300
stroke: 3
pressedColor: {0.741, 0.761, 0.831}
borderLineColor: {0.361, 0.365, 0.38}
borderLineStyle: "smooth"


textField:
Expand Down

0 comments on commit eda96f5

Please sign in to comment.