Просмотр исходного кода

Merge pull request #14 from yangfasheng/master

update blit.c
Bernard Xiong 7 лет назад
Родитель
Сommit
7963477ebb
2 измененных файлов с 6 добавлено и 6 удалено
  1. 5 5
      src/blit.c
  2. 1 1
      src/font_freetype.c

+ 5 - 5
src/blit.c

@@ -1150,7 +1150,7 @@ static void BlitAlphatoARGB8888PixelAlpha(struct rtgui_blit_info *info)
                 }
                 else
                 {
-                    dstpixel = ((rt_uint32_t)srcA << 24) | ((rt_uint32_t)srcR << 16) | ((rt_uint32_t)srcG << 8) | srcB;
+                    dstpixel = srcpixel;
                 }
 
                 *dst = dstpixel;
@@ -1218,7 +1218,7 @@ static void BlitARGB8888toARGB8888PixelAlpha(struct rtgui_blit_info *info)
                 }
                 else
                 {
-                    dstpixel = srcpixel;
+                    dstpixel = (srcpixel & 0x00FFFFFF) | ((rt_uint32_t)srcA << 24);
                 }
 
                 *dst = dstpixel;
@@ -1274,9 +1274,9 @@ BlitRGB565toARGB8888(struct rtgui_blit_info * info)
 void rtgui_blit(struct rtgui_blit_info * info)
 {
     if (info->src_h == 0 ||
-        info->src_w == 0 ||
-        info->dst_h == 0 ||
-        info->dst_w == 0)
+            info->src_w == 0 ||
+            info->dst_h == 0 ||
+            info->dst_w == 0)
         return;
 
     /* We only use the dst_w in the low level drivers. So adjust the info right

+ 1 - 1
src/font_freetype.c

@@ -269,7 +269,7 @@ static void _rtgui_rect_move_to_align(const rtgui_rect_t *rect, rtgui_rect_t *to
 
     /* move to insider of rect */
     if (RTGUI_ALIGN_TTF_SIZE & align)
-        rtgui_rect_move_to_point(to, rect->x1, rect->y1 + height * 3 / 4 - to->y2);
+        rtgui_rect_move_to_point(to, rect->x1, rect->y1 + height * 7 / 10 - to->y2);
     else
         rtgui_rect_move_to_point(to, rect->x1, rect->y1);
     PINFO(" rect align =2=>  %d %d %d %d\n", to->x1, to->y1, to->x2, to->y2);