| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -594,8 +594,7 @@ public int lineToY(int line) { | |||
| 594 | 594 | public int yToLine(int y) { | |
| 595 | 595 | FontMetrics fm = painter.getFontMetrics(); | |
| 596 | 596 | int height = fm.getHeight(); | |
| 597 | - return Math.max(0,Math.min(getLineCount() - 1, | ||
| 598 | - y / height + firstLine)); | ||
| 597 | + return Math.max(0, Math.min(getLineCount() - 1, y / height + firstLine)); | ||
| 599 | 598 | } | |
| 600 | 599 | ||
| 601 | 600 | ||
@@ -1033,8 +1032,10 @@ public final void getText(int start, int len, Segment segment) { | |||
| 1033 | 1032 | try { | |
| 1034 | 1033 | document.getText(start,len,segment); | |
| 1035 | 1034 | ||
| 1036 | - } catch(BadLocationException bl) { | ||
| 1035 | + } catch (BadLocationException bl) { | ||
| 1037 | 1036 | bl.printStackTrace(); | |
| 1037 | + System.err.format("Bad Location: %d for start %d and length %d", | ||
| 1038 | + bl.offsetRequested(), start, len); | ||
| 1038 | 1039 | segment.offset = segment.count = 0; | |
| 1039 | 1040 | } | |
| 1040 | 1041 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -604,12 +604,6 @@ public Segment getCurrentLine() { | |||
| 604 | 604 | } | |
| 605 | 605 | ||
| 606 | 606 | ||
| 607 | - // /** Old paintLine() method with kooky args order, kept around for X Mode. */ | ||
| 608 | - // @Deprecated | ||
| 609 | - // protected void paintLine(Graphics gfx, TokenMarker tokenMarker, | ||
| 610 | - // int line, int x) { | ||
| 611 | - // Font defaultFont = getFont(); | ||
| 612 | - // Color defaultColor = getForeground(); | ||
| 613 | 607 | protected void paintLine(Graphics gfx, int line, int x, | |
| 614 | 608 | TokenMarkerState tokenMarker) { | |
| 615 | 609 | currentLineIndex = line; | |
@@ -625,40 +619,37 @@ protected void paintLine(Graphics gfx, int line, int x, | |||
| 625 | 619 | } | |
| 626 | 620 | ||
| 627 | 621 | ||
| 628 | - // protected void paintLine(Graphics gfx, int line, int x, | ||
| 629 | - // TokenMarker tokenMarker) { | ||
| 630 | - // paintLine(gfx, tokenMarker, line, x); | ||
| 631 | - // } | ||
| 632 | - | ||
| 633 | - | ||
| 634 | - // protected void paintPlainLine(Graphics gfx, int line, Font defaultFont, | ||
| 635 | - // Color defaultColor, int x, int y) { | ||
| 636 | 622 | protected void paintPlainLine(Graphics gfx, int line, int x, int y) { | |
| 637 | - paintHighlight(gfx,line,y); | ||
| 638 | - textArea.getLineText(line, currentLine); | ||
| 623 | + paintHighlight(gfx, line, y); | ||
| 639 | 624 | ||
| 640 | - // gfx.setFont(plainFont); | ||
| 641 | - // gfx.setFont(defaultFont); | ||
| 642 | - // gfx.setColor(defaultColor); | ||
| 625 | + // don't try to draw lines past where they exist in the document | ||
| 626 | + // https://github.com/processing/processing/issues/5628 | ||
| 627 | + if (line < textArea.getLineCount()) { | ||
| 628 | + textArea.getLineText(line, currentLine); | ||
| 643 | 629 | ||
| 644 | - int x0 = x - textArea.getHorizontalOffset(); | ||
| 630 | + int x0 = x - textArea.getHorizontalOffset(); | ||
| 631 | + // prevent the blinking from drawing with last color used | ||
| 632 | + // https://github.com/processing/processing/issues/5628 | ||
| 633 | + gfx.setColor(defaults.fgcolor); | ||
| 634 | + gfx.setFont(plainFont); | ||
| 645 | 635 | ||
| 646 | - y += fm.getHeight(); | ||
| 647 | - // doesn't respect fixed width like it should | ||
| 636 | + y += fm.getHeight(); | ||
| 637 | + // doesn't respect fixed width like it should | ||
| 648 | 638 | // x = Utilities.drawTabbedText(currentLine, x, y, gfx, this, 0); | |
| 649 | 639 | // int w = fm.charWidth(' '); | |
| 650 | - for (int i = 0; i < currentLine.count; i++) { | ||
| 651 | - gfx.drawChars(currentLine.array, currentLine.offset+i, 1, x, y); | ||
| 652 | - x = currentLine.array[currentLine.offset + i] == '\t' ? | ||
| 640 | + for (int i = 0; i < currentLine.count; i++) { | ||
| 641 | + gfx.drawChars(currentLine.array, currentLine.offset+i, 1, x, y); | ||
| 642 | + x = currentLine.array[currentLine.offset + i] == '\t' ? | ||
| 653 | 643 | x0 + (int)nextTabStop(x - x0, i) : | |
| 654 | 644 | x + fm.charWidth(currentLine.array[currentLine.offset+i]); | |
| 655 | - textArea.offsetToX(line, currentLine.offset + i); | ||
| 656 | - } | ||
| 645 | + //textArea.offsetToX(line, currentLine.offset + i); | ||
| 646 | + } | ||
| 657 | 647 | ||
| 658 | - // Draw characters via input method. | ||
| 659 | - if (compositionTextPainter != null && | ||
| 648 | + // Draw characters via input method. | ||
| 649 | + if (compositionTextPainter != null && | ||
| 660 | 650 | compositionTextPainter.hasComposedTextLayout()) { | |
| 661 | - compositionTextPainter.draw(gfx, defaults.lineHighlightColor); | ||
| 651 | + compositionTextPainter.draw(gfx, defaults.lineHighlightColor); | ||
| 652 | + } | ||
| 662 | 653 | } | |
| 663 | 654 | if (defaults.eolMarkers) { | |
| 664 | 655 | gfx.setColor(defaults.eolMarkerColor); | |
@@ -667,9 +658,6 @@ protected void paintPlainLine(Graphics gfx, int line, int x, int y) { | |||
| 667 | 658 | } | |
| 668 | 659 | ||
| 669 | 660 | ||
| 670 | - // protected void paintSyntaxLine(Graphics gfx, TokenMarker tokenMarker, | ||
| 671 | - // int line, Font defaultFont, | ||
| 672 | - // Color defaultColor, int x, int y) { | ||
| 673 | 661 | protected void paintSyntaxLine(Graphics gfx, int line, int x, int y, | |
| 674 | 662 | TokenMarkerState tokenMarker) { | |
| 675 | 663 | textArea.getLineText(currentLineIndex, currentLine); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,10 @@ | |||
| 1 | 1 | 0269 (3.5.3) | |
| 2 | + X added reference for circle(), square(), push(), pop() | ||
| 3 | + _ has the reference.zip file been fixed? | ||
| 2 | 4 | X redo key command for Windows screwed up | |
| 3 | 5 | X https://github.com/processing/processing/issues/5773 | |
| 6 | + X fix an editor problem with plain text (css, etc) files | ||
| 7 | + X https://github.com/processing/processing/issues/5628 | ||
| 4 | 8 | ||
| 5 | 9 | ||
| 6 | 10 | contrib | |
| Back | FazBrowse Home | New Git URL |
0 commit comments