The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Prettier flags

These changes was commited to the Birdfont repository Sun, 15 Nov 2015 12:44:44 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Sun, 15 Nov 2015 12:44:44 +0000]

Updated Files

libbirdfont/EditPoint.vala
libbirdfont/StrokeTool.vala
--- a/libbirdfont/EditPoint.vala +++ b/libbirdfont/EditPoint.vala @@ -58,8 +58,6 @@ public static const uint SPLIT_POINT = 1 << 15; public static const uint SELF_INTERSECTION = 1 << 16; public static const uint COPIED_SELF_INTERSECTION = 1 << 17; - - public static const uint ALL = 0xFFFFFF; public uint flags = NONE; @@ -72,7 +70,7 @@ if (value) { flags |= ACTIVE; } else { - flags &= uint.MAX ^ ACTIVE; + flags &= ~ACTIVE; } } } @@ -86,7 +84,7 @@ if (value) { flags |= SELECTED; } else { - flags &= uint.MAX ^ SELECTED; + flags &= ~SELECTED; } } } @@ -100,7 +98,7 @@ if (value) { flags |= DELETED_POINT; } else { - flags &= uint.MAX ^ DELETED_POINT; + flags &= ~DELETED_POINT; } } } @@ -114,7 +112,7 @@ if (value) { flags |= TIE; } else { - flags &= uint.MAX ^ TIE; + flags &= ~TIE; } } } @@ -128,7 +126,7 @@ if (value) { flags |= REFLECTIVE; } else { - flags &= uint.MAX ^ REFLECTIVE; + flags &= ~REFLECTIVE; } } }
--- a/libbirdfont/StrokeTool.vala +++ b/libbirdfont/StrokeTool.vala @@ -470,7 +470,7 @@ foreach (Path p in o.paths) { foreach (EditPoint ep in p.points) { - ep.flags &= uint.MAX ^ EditPoint.COPIED; + ep.flags &= ~EditPoint.COPIED; } } @@ -584,7 +584,7 @@ // reset copied points foreach (EditPoint n in path.points) { - n.flags &= uint.MAX ^ EditPoint.COPIED; + n.flags &= ~EditPoint.COPIED; } // build list of intersection points @@ -631,7 +631,7 @@ // reset copy flag foreach (EditPoint n in path.points) { - n.flags &= uint.MAX ^ EditPoint.COPIED; + n.flags &= ~EditPoint.COPIED; } if (intersections.points.size == 0) { @@ -695,7 +695,7 @@ parts.add (merged); foreach (EditPoint n in merged.points) { - n.flags &= uint.MAX ^ EditPoint.SELF_INTERSECTION; + n.flags &= ~EditPoint.SELF_INTERSECTION; } merged.reverse (); @@ -748,7 +748,7 @@ // reset copied points foreach (EditPoint n in path2.points) { - n.flags &= uint.MAX ^ EditPoint.COPIED; + n.flags &= ~EditPoint.COPIED; } // build list of intersection points @@ -790,11 +790,11 @@ // reset copy flag foreach (EditPoint n in path1.points) { - n.flags &= uint.MAX ^ EditPoint.COPIED; + n.flags &= ~EditPoint.COPIED; } foreach (EditPoint n in path2.points) { - n.flags &= uint.MAX ^ EditPoint.COPIED; + n.flags &= ~EditPoint.COPIED; } if (intersections.points.size == 0) { @@ -966,7 +966,7 @@ bool has_curve_start = true; foreach (EditPoint e in p.points) { - e.flags &= uint.MAX ^ EditPoint.NEW_CORNER; + e.flags &= ~EditPoint.NEW_CORNER; if ((e.flags & EditPoint.CURVE) == 0) { p.set_new_start (e); @@ -2027,9 +2027,9 @@ void reset_intersections (Path p) { foreach (EditPoint ep in p.points) { - ep.flags &= uint.MAX ^ EditPoint.INTERSECTION; - ep.flags &= uint.MAX ^ EditPoint.COPIED; - ep.flags &= uint.MAX ^ EditPoint.SELF_INTERSECTION; + ep.flags &= ~EditPoint.INTERSECTION; + ep.flags &= ~EditPoint.COPIED; + ep.flags &= ~EditPoint.SELF_INTERSECTION; ep.deleted = false; } p.remove_points_on_points ();