Skip to content

[C#]: 热区判定调整 #3365

Description

@Xenon-114

检查项 / Checklist

  • 我已在 Issues 页面 中搜索,确认了这一建议未在社区版被提交过 / I have searched the Issues page and confirmed that this suggestion has not been submitted to the Community Edition yet.
  • 我确认只是全部选中而没有仔细确认就直接提交了这个 Issue,并且同意这个 Issue 可以直接被关闭 / I confirm that I checked all boxes without carefully reading them, and agree that this issue may be closed directly.
  • 我确认我所描述的改进是现实的、有理有据的,而不是我临时起意的 / I confirm that the improvement I describe is realistic, reasonable, and well-justified, rather than something I came up with on a whim.
  • 我已知悉社区不对这类 Issue 的完成时间作出任何保证,并有足够的耐心等待社区开发者的处理,同时已知悉如果我作出催促、质问或类似的举动,这个 Issue 可能会被直接关闭 / I understand that the community does not guarantee any completion time for this type of issue, and I am willing to wait patiently for the community developers' review and handling. I also understand that excessive urging, demanding, or similar behavior may result in this issue being closed.

描述 / Description

(我翻了一遍Issue没找到类似的建议,要是有的话我也同意将这个Issue关闭)
如视频所示,热区判断存在问题

202607082040.mp4

由于该功能不记录日志,我无法提供日志。

只需要做如下修改,即可修复该问题:

private nint _SizeWndProc(...)
{
    ...
    // 判定是否命中偏移后的热区
    //var inLeft = relX >= offsetPxX && relX <= offsetPxX + hitWidthPxX;
    //var inRight = relX <= w - offsetPxX && relX >= w - offsetPxX - hitWidthPxX;
    //var inTop = relY >= offsetPxY && relY <= offsetPxY + hitWidthPxY;
    //var inBottom = relY <= h - offsetPxY && relY >= h - offsetPxY - hitWidthPxY;
    var inLeft = relX >= offsetPxX && relX <= offsetPxX + hitWidthPxX             && (relY >= offsetPxY && relY <= h - offsetPxY);
    var inRight = relX <= w - offsetPxX && relX >= w - offsetPxX - hitWidthPxX    && (relY >= offsetPxY && relY <= h - offsetPxY);
    var inTop = relY >= offsetPxY && relY <= offsetPxY + hitWidthPxY              && (relX >= offsetPxX && relX <= w - offsetPxX);
    var inBottom = relY <= h - offsetPxY && relY >= h - offsetPxY - hitWidthPxY   && (relX >= offsetPxX && relX <= w - offsetPxX);
    ...
}

原因 / Reason

虽然它不算很影响操作,但我认为这样可以让它用起来更顺手
而且修复也很简单......只要添加几个判定就好了......

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions