From dc79ec52c20f653e7787b9c90145a31b7255848f Mon Sep 17 00:00:00 2001 From: Peter Keresztes Schmidt Date: Fri, 14 May 2021 20:08:25 +0200 Subject: [PATCH] Polygon: Remove API to set manually extent The extent has to be calculated from the vertices and shouldn't be modified manually. --- src/zm_box.h | 4 ---- src/zm_poly.h | 9 +-------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/zm_box.h b/src/zm_box.h index 7094f2cd0..9b9e33bc2 100644 --- a/src/zm_box.h +++ b/src/zm_box.h @@ -35,11 +35,7 @@ class Box { Box(Vector2 lo, Vector2 hi) : lo_(lo), hi_(hi), size_(Vector2::Range(hi, lo)) {} const Vector2 &Lo() const { return lo_; } - int32 LoX(int lo_x) { return lo_.x_ = lo_x; } - int32 LoY(int lo_y) { return lo_.y_ = lo_y; } const Vector2 &Hi() const { return hi_; } - int32 HiX(int hi_x) { return hi_.x_ = hi_x; } - int32 HiY(int hi_y) { return hi_.y_ = hi_y; } const Vector2 &Size() const { return size_; } int32 Area() const { return size_.x_ * size_.y_; } diff --git a/src/zm_poly.h b/src/zm_poly.h index 36d7048cc..63b85b8da 100644 --- a/src/zm_poly.h +++ b/src/zm_poly.h @@ -50,15 +50,8 @@ class Polygon { } const Box &Extent() const { return extent; } - int32 LoX(int p_lo_x) { return extent.LoX(p_lo_x); } - int32 HiX(int p_hi_x) { return extent.HiX(p_hi_x); } - int32 LoY(int p_lo_y) { return extent.LoY(p_lo_y); } - int32 HiY(int p_hi_y) { return extent.HiY(p_hi_y); } - int32 Area() const { return area; } - const Vector2 &Centre() const { - return centre; - } + const Vector2 &Centre() const { return centre; } bool Contains(const Vector2 &coord) const;