HighlightsViewUtils.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:incubator-netbeans 作者:
static int viewToIndex(TextLayout textLayout, double x, Shape alloc, Position.Bias[] biasReturn) {
    Rectangle2D bounds = ViewUtils.shapeAsRect(alloc);
    TextHitInfo hitInfo = x2Index(textLayout, (float)(x - bounds.getX()));
    if (biasReturn != null) {
        biasReturn[0] = hitInfo.isLeadingEdge() ? Position.Bias.Forward : Position.Bias.Backward;
    }
    return hitInfo.getInsertionIndex();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号