Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions coresdk/src/coresdk/clipping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ namespace splashkit_lib
LOG(WARNING) << "Attempting to push clip rect to invalid window";
return;
}

_push_clip(wnd->image, r);
}

Expand Down Expand Up @@ -119,7 +118,7 @@ namespace splashkit_lib

if ( img.clip_stack.size() > 0 )
{
rectangle clip_rect = *img.clip_stack.end();
rectangle clip_rect = img.clip_stack.back();
sk_set_clip_rect(&img.surface, clip_rect.x, clip_rect.y, clip_rect.width, clip_rect.height);
}
else
Expand Down Expand Up @@ -158,7 +157,7 @@ namespace splashkit_lib
rectangle _current_clip(const image_data &img)
{
if (img.clip_stack.size() > 0)
return *img.clip_stack.end();
return img.clip_stack.back();
else
return rectangle_from(0, 0, img.surface.width, img.surface.height);
}
Expand Down
2 changes: 1 addition & 1 deletion coresdk/src/coresdk/point_geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace splashkit_lib
v = (dot00 * dot12 - dot01 * dot02) * inv_denom;

// Check if point is in triangle
return ((u > 0.0) and (v > 0.0) and (u + v < 1.0));
return ((u >= 0) and (v >= 0) and (u + v <= 1));
}

bool point_in_rectangle(const point_2d &pt, const rectangle &rect)
Expand Down
4 changes: 3 additions & 1 deletion coresdk/src/coresdk/vector_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ namespace splashkit_lib

double angle_between(const vector_2d &v1, const vector_2d &v2)
{
return vector_angle( vector_subtract(v2, v1) );
double dot = dot_product(v1, v2);
double det = v1.x * v2.y - v1.y * v2.x;
return rad_to_deg(atan2(det, dot));
}

vector_2d vector_normal(const vector_2d &v)
Expand Down