no-wrap option; pivoted exponential zoom

This commit is contained in:
Ilia Denisov
2026-03-07 11:35:18 +02:00
committed by GitHub
parent 1de621c743
commit 477e656008
22 changed files with 605 additions and 81 deletions
+17 -10
View File
@@ -1,18 +1,20 @@
package world
// renderCirclesStageA performs a full expanded-canvas redraw but renders ONLY Circle primitives.
func (w *World) renderCirclesStageA(drawer PrimitiveDrawer, params RenderParams) error {
plan, err := w.buildRenderPlanStageA(params)
if err != nil {
return err
}
// func (w *World) renderCirclesStageA(drawer PrimitiveDrawer, params RenderParams) error {
// plan, err := w.buildRenderPlanStageA(params)
// if err != nil {
// return err
// }
drawCirclesFromPlan(drawer, plan, w.W, w.H)
return nil
}
// allowWrap := params.Options == nil || !params.Options.DisableWrapScroll
// drawCirclesFromPlan(drawer, plan, w.W, w.H, allowWrap)
// return nil
// }
// drawCirclesFromPlan executes a circles-only draw from an already built render plan.
func drawCirclesFromPlan(drawer PrimitiveDrawer, plan RenderPlan, worldW, worldH int) {
func drawCirclesFromPlan(drawer PrimitiveDrawer, plan RenderPlan, worldW, worldH int, allowWrap bool) {
for _, td := range plan.Tiles {
if td.ClipW <= 0 || td.ClipH <= 0 {
continue
@@ -40,7 +42,12 @@ func drawCirclesFromPlan(drawer PrimitiveDrawer, plan RenderPlan, worldW, worldH
copiesToDraw := make([]circleCopy, 0, len(circles))
for _, c := range circles {
shifts := circleWrapShifts(c, worldW, worldH)
var shifts []wrapShift
if allowWrap {
shifts = circleWrapShifts(c, worldW, worldH)
} else {
shifts = []wrapShift{{dx: 0, dy: 0}}
}
for _, s := range shifts {
if circleCopyIntersectsTile(c, s.dx, s.dy, td.Tile, worldW, worldH) {
copiesToDraw = append(copiesToDraw, circleCopy{c: c, dx: s.dx, dy: s.dy})