panning
This commit is contained in:
parent
162e7a7fb0
commit
7189f28c00
8 changed files with 139 additions and 33 deletions
|
|
@ -58,7 +58,8 @@ static void window_render(struct kubo_context *context) {
|
|||
struct kubo_wall *wall = kubo_wall_arr_get(&context->walls, i);
|
||||
assert(wall != NULL);
|
||||
|
||||
kubo_wall_render(wall, context->state.id == KUBO_CONTEXT_WALL_SELECT);
|
||||
kubo_wall_render(wall, context->state.id == KUBO_CONTEXT_WALL_SELECT,
|
||||
context->offset_x, context->offset_y);
|
||||
}
|
||||
|
||||
kubo_bar_render(context);
|
||||
|
|
@ -99,6 +100,8 @@ static void new_wall_click(struct kubo_context *context) {
|
|||
|
||||
int bar_limit = GetScreenHeight() - KUBO_BAR_HEIGHT;
|
||||
Vector2 new_pos = GetMousePosition();
|
||||
new_pos.x -= context->offset_x;
|
||||
new_pos.y -= context->offset_y;
|
||||
if (new_pos.y < bar_limit) {
|
||||
kubo_wall_add_vertex(current_wall, new_pos);
|
||||
current_wall->state = KUBO_WALL_DRAWING;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue