Refine large map viewport controls

This commit is contained in:
2026-06-19 18:53:03 +09:00
parent feac924a1c
commit f13f20939f
5 changed files with 67 additions and 16 deletions

View File

@@ -98,9 +98,16 @@ func _check_edge_scroll_layout_contract(failures: Array[String]) -> void:
failures.append("edge scroll clamp should not create positive board offsets")
scene.board_scroll_offset = far_offset
var far_visible_cell := Vector2i(scene.state.map_size.x - 1, scene.state.map_size.y - 1)
var far_visible_screen := scene._rect_for_cell(far_visible_cell).position + Vector2(4.0, 4.0)
if scene._cell_from_screen(far_visible_screen) != far_visible_cell:
failures.append("screen-to-cell mapping should stay stable for the visible far edge after scrolling")
var first_cell_screen := scene._rect_for_cell(Vector2i(0, 0)).position + Vector2(4.0, 4.0)
if scene._cell_from_screen(first_cell_screen) != Vector2i(0, 0):
failures.append("screen-to-cell mapping should stay stable after scrolling")
if scene._cell_from_screen(first_cell_screen) != Vector2i(-1, -1):
failures.append("hidden map cells should not accept board clicks after scrolling")
var side_panel_screen := Vector2(view_rect.end.x + 8.0, view_rect.position.y + 24.0)
if scene._cell_from_screen(side_panel_screen) != Vector2i(-1, -1):
failures.append("screen-to-cell mapping should ignore clicks outside the visible map view")
_check_edge_scroll_velocity_curve(scene, view_rect, failures)
scene.free()