Cosmetic change to floor_div function

This commit is contained in:
Francesco Abbate 2020-06-05 14:16:08 +02:00
parent c5575de058
commit baf8cec837
1 changed files with 3 additions and 4 deletions

View File

@ -223,11 +223,10 @@ void blend_solid_hspan(agg::rendering_buffer& rbuf, blender_gamma_type& blender,
} }
static int floor_div(int a, int b) { static int floor_div(int a, int b) {
int rem = a % b; if (a < 0) {
if (rem < 0) { return -((-a + b - 1) / b);
rem += b;
} }
return (a - rem) / b; return a / b;
} }
void blend_solid_hspan_rgb_subpixel(agg::rendering_buffer& rbuf, agg::gamma_lut<>& gamma, agg::lcd_distribution_lut& lcd_lut, void blend_solid_hspan_rgb_subpixel(agg::rendering_buffer& rbuf, agg::gamma_lut<>& gamma, agg::lcd_distribution_lut& lcd_lut,