mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 13:17:00 -04:00
Added image to symbol conversion
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@203 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+7
-1
@@ -114,6 +114,12 @@ enum SymbolPartCombine
|
||||
, PART_BORDER
|
||||
};
|
||||
|
||||
/// A sane mod function, always returns a result in the range [0..size)
|
||||
inline size_t mod(int a, size_t size) {
|
||||
int m = a % (int)size;
|
||||
return m >= 0 ? m : m + size;
|
||||
}
|
||||
|
||||
/// A single part (polygon/bezier-gon) in a Symbol
|
||||
class SymbolPart {
|
||||
public:
|
||||
@@ -136,7 +142,7 @@ class SymbolPart {
|
||||
|
||||
/// Get a control point, wraps around
|
||||
inline ControlPointP getPoint(int id) const {
|
||||
return points[id >= 0 ? id % points.size() : id + points.size()];
|
||||
return points[mod(id, points.size())];
|
||||
}
|
||||
|
||||
/// Enforce lock constraints
|
||||
|
||||
Reference in New Issue
Block a user