File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed
Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -267,16 +267,8 @@ impl mxcfb_rect {
267267
268268 pub fn expand ( & self , margin : u32 ) -> mxcfb_rect {
269269 mxcfb_rect {
270- left : if self . left > margin {
271- self . left - margin
272- } else {
273- 0
274- } ,
275- top : if self . top > margin {
276- self . top - margin
277- } else {
278- 0
279- } ,
270+ left : self . left . saturating_sub ( margin) ,
271+ top : self . top . saturating_sub ( margin) ,
280272 width : self . width + ( 2 * margin) ,
281273 height : self . height + ( 2 * margin) ,
282274 }
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ impl framebuffer::FramebufferDraw for core::Framebuffer {
5555 v,
5656 ) ,
5757 } ;
58- let margin = ( width + 1 ) / 2 ;
58+ let margin = width. div_ceil ( 2 ) ;
5959 graphics:: stamp_along_line ( stamp, start, end) . expand ( margin)
6060 }
6161
You can’t perform that action at this time.
0 commit comments