Skip to content

[#1261] Fix quadtree debug drawing not rendering#1262

Merged
obiot merged 1 commit intomasterfrom
fix/quadtree-debug-drawing
Mar 17, 2026
Merged

[#1261] Fix quadtree debug drawing not rendering#1262
obiot merged 1 commit intomasterfrom
fix/quadtree-debug-drawing

Conversation

@obiot
Copy link
Copy Markdown
Member

@obiot obiot commented Mar 17, 2026

Summary

Fix quadtree debug visualization not rendering. The _drawQuadTree() method runs in GAME_AFTER_DRAW which fires after renderer.flush(), so the draw calls were never submitted to the GPU.

Fix: add an explicit renderer.flush() after drawing the quadtree.

Also bumps debug plugin to 15.0.2 with changelog entry.

Closes #1261

Test plan

  • Debug plugin builds
  • Quadtree visualization verified in platformer example

🤖 Generated with Claude Code

_drawQuadTree() runs in GAME_AFTER_DRAW which fires after
renderer.flush(). Add an explicit flush() after drawing so
the quadtree lines are submitted to the GPU.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 17, 2026 10:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the debug plugin’s quadtree visualization when running with the WebGL renderer by ensuring quadtree draw calls are flushed after they are issued in the GAME_AFTER_DRAW hook (which runs after the engine’s main renderer.flush()).

Changes:

  • Flushes the renderer after drawing the quadtree overlay so WebGL batched primitives are submitted.
  • Bumps @melonjs/debug-plugin version to 15.0.2.
  • Documents the fix in the debug plugin changelog.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/debug-plugin/src/debugPanel.js Adds a post-quadtree renderer.flush() so the overlay renders when drawn after the main frame flush.
packages/debug-plugin/package.json Version bump from 15.0.1 to 15.0.2.
packages/debug-plugin/CHANGELOG.md Adds release notes for 15.0.2 describing the quadtree rendering fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@obiot obiot merged commit ddcb839 into master Mar 17, 2026
12 checks passed
@obiot obiot deleted the fix/quadtree-debug-drawing branch March 17, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quadtree debug drawing broken — renders after renderer flush

2 participants