fix(sdk/hello): M2.71控件真机bug批次 — 圆形进度脏区+整环修复/Slider拖动/Dialog·Sheet背景快照scrim不叠黑/Disabled圆角α/点击重置息屏/滑动跟手/IME残影·键位·主题配色/List选中点击 (agent-162)
This commit is contained in:
1 parent
b12404a986
commit
b8c36bd33c
14 files changed
+554
-79
No files matched your search
@@ -179,6 +179,10 @@ void meow_gfx_mark_dirty(int x, int y, int w, int h) { dirty_add(x, y, w, h); }
|
||||
void meow_gfx_mark_full(void) { dirty_full(); }
|
||||
void meow_gfx_dirty_reset(void) { dirty_reset(); }
|
||||
|
||||
/* back_buf 每行字节数 / 位深(M2.71-bug3:模态/IME 整帧快照恢复用)。 */
|
||||
int meow_ui_back_buf_pitch(void) { return g_line; }
|
||||
int meow_ui_back_buf_bpp(void) { return g_bpp; }
|
||||
|
||||
/* launcher(系统组件)与 SDK 共用同一 back_buf:launcher 的 fb 绘制指针指向它,
|
||||
* 从而 launcher 与 app 统一渲染栈(同一离屏 + 同一 present)。 */
|
||||
unsigned char *meow_ui_back_buf(void) { return g_back_buf; }
|
||||
@@ -393,6 +397,23 @@ void meow_ui_draw_rect_round(int x, int y, int w, int h, int r, uint32_t color)
|
||||
dirty_add(x1, y1, x2 - x1, y2 - y1);
|
||||
}
|
||||
|
||||
/* 圆角矩形半透明填充(M2.71-bug4):按圆角裁剪后逐像素混合 α。供「禁用变暗」等状态层用,
|
||||
* 避免在圆角外的方形区域也叠色(旧 fill_rect_alpha 会在圆角外露出灰方块)。 */
|
||||
void meow_gfx_fill_round_alpha(int x, int y, int w, int h, int r, uint32_t color, int alpha)
|
||||
{
|
||||
if (!g_init_ok) return;
|
||||
if (alpha <= 0) return;
|
||||
if (alpha >= 255) { meow_gfx_fill_round(x, y, w, h, r, color); return; }
|
||||
if (w <= 0 || h <= 0) return;
|
||||
int x1 = x, y1 = y, x2 = x + w, y2 = y + h;
|
||||
if (x1 < 0) x1 = 0; if (y1 < 0) y1 = 0;
|
||||
if (x2 > g_xres) x2 = g_xres; if (y2 > g_yres) y2 = g_yres;
|
||||
for (int py = y1; py < y2; py++)
|
||||
for (int px = x1; px < x2; px++)
|
||||
if (rr_inside(px, py, x, y, w, h, r)) put_px_blend(px, py, color, alpha);
|
||||
dirty_add(x1, y1, x2 - x1, y2 - y1);
|
||||
}
|
||||
|
||||
/* ================= §5.8.6 batch2:圆形/线段/圆弧环(软渲,无 -lm) =================
|
||||
* 无 GPU 合成、构建只链 libz+pthread(无 -lm),故不用 math.h:COS 用象限对称查表、
|
||||
* 圆用 bbox 距离测试、弧带用「沿弧采样成粗线(圆帽)」近似。 */
|
||||
@@ -462,7 +483,9 @@ void meow_gfx_ring_arc(int cx, int cy, int r, int th, int start_deg, int sweep_d
|
||||
if (!g_init_ok || r <= 0) return;
|
||||
int sw = sweep_deg % 360;
|
||||
if (sw < 0) sw += 360;
|
||||
if (sw >= 360) { /* 整环:bbox 距离带(无角度判定,最快) */
|
||||
/* 整环(|sweep|>=360):bbox 距离带(无角度判定,最快)。注意 sweep=360 → sw=0,
|
||||
* 若靠 sw>=360 判整环会落下走弧分支只画一个点(顺带让 Radio 外圈/圆形进度轨道环渲染成点)。 */
|
||||
if (sweep_deg >= 360 || sweep_deg <= -360) {
|
||||
int r1 = r - th / 2, r2 = r + th / 2;
|
||||
if (r1 < 0) r1 = 0;
|
||||
int x1 = cx - r2, y1 = cy - r2, x2 = cx + r2 + 1, y2 = cy + r2 + 1;
|
||||
@@ -478,6 +501,7 @@ void meow_gfx_ring_arc(int cx, int cy, int r, int th, int start_deg, int sweep_d
|
||||
dirty_add(x1, y1, x2 - x1, y2 - y1);
|
||||
return;
|
||||
}
|
||||
if (sw == 0) return; /* 零弧长:不画(sweep=0;整环已在上面处理) */
|
||||
/* 弧带:沿弧采样相邻点、粗线连接(圆帽)近似。方向:deg 右(0)→上(90)→左(180)→下(270),顺时针。 */
|
||||
int n = sw / 2 + 1;
|
||||
if (n < 2) n = 2;
|
||||
|
||||
Reference in new issue
Block a user