From d85df53b64030569ad3549ab463b96d54f919cfa Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Sun, 8 Dec 2019 02:29:49 +0100 Subject: fix background cropping --- src/render.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/render.rs') diff --git a/src/render.rs b/src/render.rs index 927782c..437b66c 100644 --- a/src/render.rs +++ b/src/render.rs @@ -40,10 +40,10 @@ impl Default for RenderOptions { fn default() -> Self { RenderOptions { skill_size: 100, - traitline_height: 160, - traitline_width: 550, + traitline_height: 137, + traitline_width: 647, traitline_brightness: 100, - traitline_x_offset: 0, + traitline_x_offset: 200, trait_size: 30, line_color: Rgba([0, 0, 0, 255]), line_height: 4, @@ -58,8 +58,14 @@ impl Default for RenderOptions { } } -const BG_CROP_HEIGHT: u32 = 160; -const BG_CROP_WIDTH: u32 = 550; +// These values were determined from the thief specialization background images, as those do not +// have anything fancy going on and are instead transparent. Therefore, we can use them as a +// "reference" for the intended specialization crop size. +// +// Note: Increasing those values will mean that thief build templates will end up with more +// transparency than intended. +const BG_CROP_HEIGHT: u32 = 136; +const BG_CROP_WIDTH: u32 = 647; pub struct Renderer<'r> { api: &'r mut Api, -- cgit v1.2.3