minus zoom
This commit is contained in:
+18
-3
@@ -1,3 +1,4 @@
|
||||
#include "ui.hpp"
|
||||
#include "tree.hpp"
|
||||
#include "utils.hpp"
|
||||
#include "assert.h"
|
||||
@@ -14,10 +15,22 @@ namespace
|
||||
person_id selectRightSib(const Tree& t, person_id selected);
|
||||
}
|
||||
|
||||
ZoomLevel operator++(ZoomLevel& z)
|
||||
{
|
||||
z = (ZoomLevel)(z + 1);
|
||||
return z;
|
||||
}
|
||||
|
||||
ZoomLevel operator--(ZoomLevel& z)
|
||||
{
|
||||
z = (ZoomLevel)(z - 1);
|
||||
return z;
|
||||
}
|
||||
|
||||
void displayTree(Tree& t)
|
||||
{
|
||||
person_id selected = 0; // the currently selected selected
|
||||
U8 zoom = 0; // how much info to show for each selected
|
||||
ZoomLevel zoom = ZoomLevel::FIRST_NAME; // how much info to show for each selected
|
||||
|
||||
// offset of the tree in relation to the top left corner of the screen
|
||||
I16 offsetY = 0, offsetX = 0;
|
||||
@@ -57,10 +70,12 @@ void displayTree(Tree& t)
|
||||
break;
|
||||
case '=':
|
||||
case '+':
|
||||
zoom = 1;
|
||||
if(zoom < ZoomLevel::MAX_ZOOM)
|
||||
++zoom;
|
||||
break;
|
||||
case '-':
|
||||
zoom = 0;
|
||||
if(zoom > 0)
|
||||
--zoom;
|
||||
break;
|
||||
case SELECT_LEFT:
|
||||
selected = selectLeft(t, selected);
|
||||
|
||||
Reference in New Issue
Block a user