#include <stdexcept>
#include <sstream>
-#include "math/rect.hpp"
+#include "math/rectf.hpp"
#include "util/log.hpp"
std::string anchor_point_to_string(AnchorPoint point)
throw std::runtime_error(msg.str());
}
-Vector get_anchor_pos(const Rect& rect, AnchorPoint point)
+Vector get_anchor_pos(const Rectf& rect, AnchorPoint point)
{
Vector result;
result.x = rect.get_right();
break;
default:
-#ifdef DEBUG
- throw std::runtime_error("Invalid anchor point found");
-#endif
log_warning << "Invalid anchor point found" << std::endl;
result.x = rect.get_left();
break;
result.y = rect.get_bottom();
break;
default:
-#ifdef DEBUG
- throw std::runtime_error("Invalid anchor point found");
-#endif
log_warning << "Invalid anchor point found" << std::endl;
result.y = rect.get_top();
break;
return result;
}
-Vector get_anchor_pos(const Rect& destrect, float width, float height,
+Vector get_anchor_pos(const Rectf& destrect, float width, float height,
AnchorPoint point)
{
Vector result;
result.x = destrect.get_right() - width;
break;
default:
-#ifdef DEBUG
- throw std::runtime_error("Invalid anchor point found");
-#endif
log_warning << "Invalid anchor point found" << std::endl;
result.x = destrect.get_left();
break;
result.y = destrect.get_bottom() - height;
break;
default:
-#ifdef DEBUG
- throw std::runtime_error("Invalid anchor point found");
-#endif
log_warning << "Invalid anchor point found" << std::endl;
result.y = destrect.get_top();
break;