This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 183521 - Dimensions relating to TAB character seem incorrect
Summary: Dimensions relating to TAB character seem incorrect
Status: RESOLVED WORKSFORME
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords: REGRESSION
Depends on:
Blocks: 179047
  Show dependency tree
 
Reported: 2010-04-06 02:16 UTC by err
Modified: 2012-11-01 15:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description err 2010-04-06 02:16:53 UTC
Tabs don't display in NB's "overwrite" mode as they used to. This also afects how jVi displays over a tab char.

The following shows what NB's ExtCaret.paint() is seeing. The first two lines are over a regular character and the next lines are after moving the caret down one line onto a tab character. It is interesting how the clip region changes after moving to the next line.

      ==ModelToView==                      ==Graphics.getClipBounds==
Rect[x=0,y=153,width=8,height=17]      Rect[x=0,y=153,width=8,height=17]
Rect[x=0,y=153,width=8,height=17]      Rect[x=0,y=153,width=8,height=17]

KeyAction: ViDownKey: e001(1) 0 virt

Rect[x=0,y=170,width=1,height=17]      Rect[x=0,y=153,width=447,height=51]
Rect[x=0,y=170,width=1,height=17]      Rect[x=0,y=153,width=447,height=17]
Rect[x=0,y=170,width=1,height=17]      Rect[x=0,y=170,width=2,height=17]
Rect[x=0,y=170,width=1,height=17]      Rect[x=0,y=170,width=2,height=17]


Somewhat OffTopic, though related. In .../view/NewlineView.java there is the following code which handle a similar issue with newline. I'm confused about a part of it. For axis==View.X_AXIS when not showNonPrint defaultLineHeight is returned. At first glance it seems incorrect to be returning any height for X_AXIS. Before the change this was an "advance", which I still don't entirely understand from the javadoc, but it does seem to be an "X" thing. So the use of line height might be a bug.

    @Override
    public float getPreferredSpan(int axis) {
        // Although the width could be e.g. 1 return a default width of a character
        // since if caret is blinking over the newline character and the caret
        // is in overwrite mode then this will make the caret fully visible.
        DocumentView documentView = getDocumentView();
        if (axis == View.X_AXIS) {
            return (documentView != null)
                    ? (documentView.isShowNonprintingCharacters()
                        ? documentView.getDefaultLineHeight()
                        : documentView.getDefaultCharWidth())
                    : 1; // Only return one if not connected to view hierarchy
        } else {
            return (documentView != null) ? documentView.getDefaultLineHeight() : 1;
        }
    }
Comment 1 David Strupl 2012-11-01 09:01:15 UTC
This report is before the big changes in the views. I am closing as works for me. If still a problem in 7.3 or later please reopen.