()
| 323 | } |
| 324 | |
| 325 | func (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 | |
| 366 | func (project *Project) Save() { |
| 367 |
nothing calls this directly
no test coverage detected