Browse Source

can't tell my left from my right

David Rose 18 years ago
parent
commit
6f76b082fa
3 changed files with 5 additions and 5 deletions
  1. 1 1
      panda/src/egg/eggGroupNode.I
  2. 1 1
      panda/src/egg/eggGroupNode.h
  3. 3 3
      panda/src/pgui/pgItem.cxx

+ 1 - 1
panda/src/egg/eggGroupNode.I

@@ -24,7 +24,7 @@
 ////////////////////////////////////////////////////////////////////
 INLINE bool EggGroupNode::
 is_right(const LVector2d &v1, const LVector2d &v2) {
-  return (-v1[0] * v2[1] + v1[1] * v2[0]) > 0;
+  return (v1[0] * v2[1] - v1[1] * v2[0]) > 0;
 }
 
 ////////////////////////////////////////////////////////////////////

+ 1 - 1
panda/src/egg/eggGroupNode.h

@@ -183,7 +183,7 @@ protected:
                         CoordinateSystem coordsys,
                         BamCacheRecord *record);
 
-private:
+PUBLISHED:
   INLINE static bool is_right(const LVector2d &v1, const LVector2d &v2);
 
 private:

+ 3 - 3
panda/src/pgui/pgItem.cxx

@@ -51,7 +51,7 @@ PGItem::BackgroundFocus PGItem::_background_focus;
 ////////////////////////////////////////////////////////////////////
 INLINE bool
 is_right(const LVector2f &v1, const LVector2f &v2) {
-  return (-v1[0] * v2[1] + v1[1] * v2[0]) > 0;
+  return (v1[0] * v2[1] - v1[1] * v2[0]) > 0;
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -1272,12 +1272,12 @@ clip_frame(pvector<LPoint2f> &source_points, const Planef &plane) const {
   new_points.reserve(source_points.size() + 1);
 
   LPoint2f last_point = source_points.back();
-  bool last_is_in = !is_right(last_point - from2d, delta2d);
+  bool last_is_in = is_right(last_point - from2d, delta2d);
   bool all_in = last_is_in;
   pvector<LPoint2f>::const_iterator pi;
   for (pi = source_points.begin(); pi != source_points.end(); ++pi) {
     const LPoint2f &this_point = (*pi);
-    bool this_is_in = !is_right(this_point - from2d, delta2d);
+    bool this_is_in = is_right(this_point - from2d, delta2d);
 
     // There appears to be a compiler bug in gcc 4.0: we need to
     // extract this comparison outside of the if statement.