MCPcopy Create free account
hub / github.com/SolarLune/masterplan / Draw

Method Draw

project.go:325–364  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

323}
324
325func (project *Project) Draw() {
326
327 if globals.NextProject != nil && globals.NextProject != project {
328 // You're the old project, so you can just chill. We do this
329 // because otherwise, a card may use a resource that got destroyed
330 // to render.
331 return
332 }
333
334 if (project.Camera.Zoom >= 1 || !globals.Settings.Get(SettingsHideGridOnZoomOut).AsBool()) && globals.Settings.Get(SettingsShowGrid).AsBool() {
335 project.DrawGrid()
336 }
337
338 // gridPieceToScreenW := globals.ScreenSize.X / project.GridTexture.Size.X / project.Camera.TargetZoom
339 // gridPieceToScreenH := globals.ScreenSize.Y / project.GridTexture.Size.Y / project.Camera.TargetZoom
340
341 // for iy := -gridPieceToScreenH; iy < gridPieceToScreenH; iy++ {
342 // for ix := -gridPieceToScreenW; ix < gridPieceToScreenW; ix++ {
343
344 // x := float32(ix * project.GridTexture.Size.X)
345 // x += float32(math.Round(float64(project.Camera.Position.X / project.GridTexture.Size.X * project.GridTexture.Size.X)))
346
347 // y := float32(iy * project.GridTexture.Size.Y)
348 // y += float32(math.Round(float64(project.Camera.Position.Y / project.GridTexture.Size.Y * project.GridTexture.Size.Y)))
349
350 // // x -= int32(project.Camera.Position.X)
351
352 // translated := project.Camera.Translate(&sdl.FRect{x, y, 0, 0})
353
354 // drawGridPiece(translated.X, translated.Y)
355
356 // }
357 // }
358
359 project.CurrentPage.Draw()
360
361 // We want this here so anything else can intercept a mouse button click (for example, a button drawn from a Card).
362 project.MouseActions()
363
364}
365
366func (project *Project) Save() {
367

Callers

nothing calls this directly

Calls 5

DrawGridMethod · 0.95
MouseActionsMethod · 0.95
AsBoolMethod · 0.80
DrawMethod · 0.65
GetMethod · 0.45

Tested by

no test coverage detected