DocumentViewOp.java 文件源码

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

项目:incubator-netbeans 作者:
/**
 * Get width available for display of child views. For non-wrap case it's Integer.MAX_VALUE
 * and for wrapping it's a display width or (if display width would become too narrow)
 * a width of four chars to not overflow the word wrapping algorithm.
 * @return 
 */
float getAvailableWidth() {
    if (!isAnyStatusBit(AVAILABLE_WIDTH_VALID)) {
        // Mark valid and assign early values to prevent stack overflow in getLineContinuationCharTextLayout()
        setStatusBits(AVAILABLE_WIDTH_VALID);
        availableWidth = Integer.MAX_VALUE;
        renderWrapWidth = availableWidth;
        TextLayout lineContTextLayout = getLineContinuationCharTextLayout();
        if (lineContTextLayout != null && (getLineWrapType() != LineWrapType.NONE)) {
            availableWidth = Math.max(getVisibleRect().width, 4 * getDefaultCharWidth() + lineContTextLayout.getAdvance());
            renderWrapWidth = availableWidth - lineContTextLayout.getAdvance();
        }
    }
    return availableWidth;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号