Skip to content

Instantly share code, notes, and snippets.

@comefrombottom
comefrombottom / GridWalker.cpp
Last active January 20, 2024 17:22
格子上のLineが通るIndexを順に返すイテレータ
# include <Siv3D.hpp>
void dragVec2(Vec2& v, bool& dragging, double r = 5) {
if (v.asCircle(r).leftClicked())dragging = true;
if (MouseL.up()) {
if (KeySpace.pressed()) {
constexpr Point step{ 10,10 };
v = Floor(v / step + Vec2{0.5, 0.5})* step;
}
dragging = false;