text simple placement: add center 'C' placement
This commit is contained in:
parent
10deff9d5d
commit
4eae86b7bc
3 changed files with 5 additions and 1 deletions
|
@ -96,7 +96,8 @@ enum directions_e : std::uint8_t
|
|||
SOUTHEAST,
|
||||
NORTHWEST,
|
||||
SOUTHWEST,
|
||||
EXACT_POSITION
|
||||
EXACT_POSITION,
|
||||
CENTER
|
||||
};
|
||||
|
||||
using fontset_map = std::map<std::string, font_set>;
|
||||
|
|
|
@ -57,6 +57,7 @@ struct direction_name : x3::symbols<directions_e>
|
|||
("NW", NORTHWEST)
|
||||
("SW", SOUTHWEST)
|
||||
("X" , EXACT_POSITION)
|
||||
("C" , CENTER)
|
||||
;
|
||||
}
|
||||
} names;
|
||||
|
|
|
@ -79,6 +79,8 @@ pixel_position evaluate_displacement(double dx, double dy, directions_e dir)
|
|||
return pixel_position(-std::abs(dx),-std::abs(dy));
|
||||
case SOUTHWEST:
|
||||
return pixel_position(-std::abs(dx),std::abs(dy));
|
||||
case CENTER:
|
||||
return pixel_position(0, 0);
|
||||
default:
|
||||
return pixel_position(dx,dy);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue