ArthurHub / ArthurHub/HTML-Renderer

Location not working for negative values, gets pushed to 0

未關閉
#44 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug enhancement
主要語言
C#
星號
1.4k
分支
550
平均合併
14 天 9 小時
30 天內合併 PR
1

描述

Hi, I am trialling this and so far it's awesome. Just found one thing though trying to render HTML into a custom List Box and sometimes (for items at the top) painting needs to start at a location with a -Y for a partially drawn list item. I believe that I have found the problem and here is my fix, so far it seems OK (the Demo still looks all good).

In Layout cells there are some calls to Math.Max where the 2nd param is 0, it should be the existing Location value.

private void LayoutCells(RGraphics g)
{
double startx = Math.Max(_tableBox.ClientLeft + GetHorizontalSpacing(), _tableBox.Location.X);
double starty = Math.Max(_tableBox.ClientTop + GetVerticalSpacing(), _tableBox.Location.Y);
....
}

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

在 C# 原始碼中找到 LayoutCells 方法,並檢查目前與 0 比較的 Math.Max 呼叫。使用 Y 位置為負的部分繪製項目重現渲染,然後確認在保留表格框位置後,版面配置和現有的 Demo 仍能正確渲染。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
csharp
領域
frontend
Issue 類型
缺陷
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。