mirror of
https://github.com/Fluffy-Bean/ColouringApp.git
synced 2025-05-14 07:32:16 +00:00
Support resizing canvas though not used really
This commit is contained in:
parent
00c449abff
commit
9cfdd651b7
2 changed files with 4 additions and 1 deletions
|
@ -20,6 +20,8 @@ type Canvas struct {
|
||||||
|
|
||||||
func (c *Canvas) Update() {
|
func (c *Canvas) Update() {
|
||||||
if c.Refresh {
|
if c.Refresh {
|
||||||
|
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)
|
||||||
for _, mark := range c.Strokes {
|
for _, mark := range c.Strokes {
|
||||||
|
|
3
main.go
3
main.go
|
@ -58,7 +58,7 @@ func main() {
|
||||||
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)
|
||||||
|
|
||||||
canvas = NewCanvas("NewProject", raylib.NewVector2(600, 530), raylib.NewVector2(15, 15))
|
canvas = NewCanvas("NewProject", raylib.NewVector2(700, 530), raylib.NewVector2(15, 15))
|
||||||
currentStroke = penTool{}
|
currentStroke = penTool{}
|
||||||
|
|
||||||
sidePanelWidth = float32(350)
|
sidePanelWidth = float32(350)
|
||||||
|
@ -210,6 +210,7 @@ func main() {
|
||||||
if choice == 0 || choice == 1 {
|
if choice == 0 || choice == 1 {
|
||||||
state = StateNormal
|
state = StateNormal
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawToasts()
|
DrawToasts()
|
||||||
|
|
Loading…
Add table
Reference in a new issue