~ruther/CTU-FEE-B0B35APO-Semestral-project

ref: 62fe007cfcf4b3951bf7b2289c08a8a149f03714 CTU-FEE-B0B35APO-Semestral-project/image-viewer/src/direction.c -rw-r--r-- 308 bytes
62fe007c — František Boháček feat: add zooming to cursor 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "direction.h"

void direction_move_xy(direction_t direction, int32_t *x, int32_t *y, int16_t amount) {
  switch (direction) {
  case LEFT:
    *x -= amount;
    break;
  case RIGHT:
    *x += amount;
    break;
  case UP:
    *y -= amount;
    break;
  case DOWN:
    *y += amount;
    break;
  }
}
Do not follow this link