@@ -26,7 +26,7 @@ function outline_drawer(_viewport = 0, _outline_color = c_white, _outline_alpha
2626
2727 // html flips the final surface vertically... hell knows, why.
2828 // so, on html we need to draw it upside down.
29- __draw_yscale = (os_browser != browser_not_a_browser) ? - 1 : 1 ;
29+ __flip_vertical = (os_browser != browser_not_a_browser);
3030
3131 viewport = _viewport;
3232 camera = view_get_camera (_viewport);
@@ -141,10 +141,19 @@ function outline_drawer(_viewport = 0, _outline_color = c_white, _outline_alpha
141141 surface_reset_target ();
142142
143143 // Draw surface 2
144- draw_surface_ext (__outline_surface_2,
145- _obj.bbox_left - outline_strength - 1 ,
146- (__draw_yscale == 1 ? _obj.bbox_top - outline_strength - 1 : _obj.bbox_bottom + outline_strength + 2 ),
147- 1 , __draw_yscale, 0 , c_white, 1 );
144+ if (__flip_vertical) {
145+ // as we increase the surface only when needed but never shrink (for performance)
146+ // we need the current_dimensions here for correct rendering in html (surface_get_height)
147+ draw_surface_ext (__outline_surface_2,
148+ _obj.bbox_left - outline_strength - 1 ,
149+ _obj.bbox_top + surface_get_height (__outline_surface_2) - outline_strength - 1 ,
150+ 1 , -1 , 0 , c_white, 1 );
151+ } else {
152+ draw_surface_ext (__outline_surface_2,
153+ _obj.bbox_left - outline_strength - 1 ,
154+ _obj.bbox_top - outline_strength - 1 ,
155+ 1 , 1 , 0 , c_white, 1 );
156+ }
148157
149158 return true ;
150159
0 commit comments