Explorar o código

fix:scale不应该有0的情况

Dozingfiretruck %!s(int64=3) %!d(string=hai) anos
pai
achega
26ffad117b
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      components/u8g2/luat_lib_u8g2.c

+ 1 - 0
components/u8g2/luat_lib_u8g2.c

@@ -665,6 +665,7 @@ static int l_u8g2_DrawDrcode(lua_State *L)
     if (ok){
         int qr_size = qrcodegen_getSize(qrcode);
         int scale = size / qr_size ;
+        if (!scale)scale = 1;
         int margin = (size - qr_size * scale) / 2;
         x+=margin;
         y+=margin;