Support resizing canvas though not used really

This commit is contained in:
Michał 2024-01-25 20:48:38 +00:00
parent 00c449abff
commit 9cfdd651b7
2 changed files with 4 additions and 1 deletions

View file

@ -20,6 +20,8 @@ type Canvas struct {
func (c *Canvas) Update() {
if c.Refresh {
c.Target = raylib.LoadRenderTexture(int32(c.Size.X), int32(c.Size.Y))
raylib.BeginTextureMode(c.Target)
raylib.ClearBackground(raylib.White)
for _, mark := range c.Strokes {

View file

@ -58,7 +58,7 @@ func main() {
var (
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{}
sidePanelWidth = float32(350)
@ -210,6 +210,7 @@ func main() {
if choice == 0 || choice == 1 {
state = StateNormal
}
default:
}
DrawToasts()