mirror of
https://github.com/Fluffy-Bean/ColouringApp.git
synced 2025-05-14 07:32:16 +00:00
Merge pull request #1 from Fluffy-Bean/deepsource-transform-07985dc4
style: format code with Gofumpt
This commit is contained in:
commit
1993111390
3 changed files with 9 additions and 11 deletions
|
@ -26,7 +26,7 @@ func (c *Canvas) Update() {
|
||||||
c.Target = raylib.LoadRenderTexture(int32(c.Size.X), int32(c.Size.Y))
|
c.Target = raylib.LoadRenderTexture(int32(c.Size.X), int32(c.Size.Y))
|
||||||
|
|
||||||
raylib.BeginTextureMode(c.Target)
|
raylib.BeginTextureMode(c.Target)
|
||||||
//raylib.ClearBackground(raylib.White)
|
// raylib.ClearBackground(raylib.White)
|
||||||
raylib.DrawTexturePro(
|
raylib.DrawTexturePro(
|
||||||
c.Background,
|
c.Background,
|
||||||
raylib.NewRectangle(0, 0, c.Size.X, -c.Size.Y),
|
raylib.NewRectangle(0, 0, c.Size.X, -c.Size.Y),
|
||||||
|
|
16
main.go
16
main.go
|
@ -30,9 +30,7 @@ const (
|
||||||
StateFileMenu
|
StateFileMenu
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var canvas *Canvas
|
||||||
canvas *Canvas
|
|
||||||
)
|
|
||||||
|
|
||||||
func checkDirs() {
|
func checkDirs() {
|
||||||
if _, err := os.Stat(DirAssets); os.IsNotExist(err) {
|
if _, err := os.Stat(DirAssets); os.IsNotExist(err) {
|
||||||
|
@ -49,15 +47,15 @@ func main() {
|
||||||
checkDirs() // Make sure all the directories exist
|
checkDirs() // Make sure all the directories exist
|
||||||
|
|
||||||
raylib.SetConfigFlags(raylib.FlagWindowResizable)
|
raylib.SetConfigFlags(raylib.FlagWindowResizable)
|
||||||
//raylib.SetTraceLogLevel(raylib.LogTrace)
|
// raylib.SetTraceLogLevel(raylib.LogTrace)
|
||||||
//raylib.SetConfigFlags(raylib.FlagMsaa4xHint)
|
// raylib.SetConfigFlags(raylib.FlagMsaa4xHint)
|
||||||
//raylib.SetConfigFlags(raylib.FlagVsyncHint)
|
// raylib.SetConfigFlags(raylib.FlagVsyncHint)
|
||||||
//raylib.SetConfigFlags(raylib.FlagFullscreenMode)
|
// raylib.SetConfigFlags(raylib.FlagFullscreenMode)
|
||||||
|
|
||||||
raylib.InitWindow(WindowWidth, WindowHeight, WindowTitle)
|
raylib.InitWindow(WindowWidth, WindowHeight, WindowTitle)
|
||||||
raylib.SetWindowMinSize(int(WindowMinWidth), int(WindowMinHeight))
|
raylib.SetWindowMinSize(int(WindowMinWidth), int(WindowMinHeight))
|
||||||
raylib.SetTargetFPS(int32(raylib.GetMonitorRefreshRate(raylib.GetCurrentMonitor())))
|
raylib.SetTargetFPS(int32(raylib.GetMonitorRefreshRate(raylib.GetCurrentMonitor())))
|
||||||
//raylib.SetExitKey(0) // disable exit key
|
// raylib.SetExitKey(0) // disable exit key
|
||||||
|
|
||||||
var (
|
var (
|
||||||
camera = raylib.NewCamera2D(raylib.NewVector2(0, 0), raylib.NewVector2(0, 0), 0, 1)
|
camera = raylib.NewCamera2D(raylib.NewVector2(0, 0), raylib.NewVector2(0, 0), 0, 1)
|
||||||
|
@ -66,7 +64,7 @@ func main() {
|
||||||
|
|
||||||
sidePanelWidth = float32(350)
|
sidePanelWidth = float32(350)
|
||||||
sidePanelRelativeX = WindowWidth - int32(sidePanelWidth)
|
sidePanelRelativeX = WindowWidth - int32(sidePanelWidth)
|
||||||
//sidePanelPos = sidePanelRelativeX
|
// sidePanelPos = sidePanelRelativeX
|
||||||
|
|
||||||
colourPickerVal = raylib.Orange
|
colourPickerVal = raylib.Orange
|
||||||
colourPickerHeight = float32(250)
|
colourPickerHeight = float32(250)
|
||||||
|
|
2
toast.go
2
toast.go
|
@ -45,7 +45,7 @@ func DrawToasts() {
|
||||||
raylib.BeginScissorMode(0, 0, WindowWidth, int32(toastHeight))
|
raylib.BeginScissorMode(0, 0, WindowWidth, int32(toastHeight))
|
||||||
raylib.DrawRectangle(0, 0, WindowWidth, WindowHeight, raylib.Fade(raylib.Black, 0.5))
|
raylib.DrawRectangle(0, 0, WindowWidth, WindowHeight, raylib.Fade(raylib.Black, 0.5))
|
||||||
for i := 0; i < len(toasts); i++ {
|
for i := 0; i < len(toasts); i++ {
|
||||||
//text := fmt.Sprintf("%s (%s)", toasts[i].Text, time.Since(toasts[i].Age).Round(time.Second))
|
// text := fmt.Sprintf("%s (%s)", toasts[i].Text, time.Since(toasts[i].Age).Round(time.Second))
|
||||||
text := toasts[i].Text
|
text := toasts[i].Text
|
||||||
raylib.DrawText(text, 10, int32(20*i)+10, 10, raylib.White)
|
raylib.DrawText(text, 10, int32(20*i)+10, 10, raylib.White)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue