From 4758cf763f7f762dd8110fd6ed2b3de4a68cbd94 Mon Sep 17 00:00:00 2001 From: Keuin Date: Wed, 20 Apr 2022 02:58:37 +0800 Subject: Assert screen and image are of the same aspect in aa_viewport::aa_viewport and basic_viewport::basic_viewport. --- viewport.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'viewport.h') diff --git a/viewport.h b/viewport.h index 02c1466..85f63c4 100644 --- a/viewport.h +++ b/viewport.h @@ -75,7 +75,9 @@ public: cxyz{cxyz}, screen_center{screen_center}, image_width{image_width}, image_height{image_height}, screen_hw{screen_hw}, screen_hh{screen_hh}, - world{world} {} + world{world} { + assert(std::abs(1.0 * image_width / image_height - 1.0 * screen_hw / screen_hh) < 1e-8); + } /** * Generate the image seen on given viewpoint. -- cgit v1.2.3