fix for bug #737 (doubled geometry in 3D), and an indent/outdent

comment/uncomment bug
This commit is contained in:
benfry
2008-08-16 01:38:45 +00:00
parent 2b1bb723d4
commit 57b94aaccc
5 changed files with 22 additions and 10 deletions
+10 -4
View File
@@ -1164,12 +1164,15 @@ public class Editor extends JFrame {
int startLine = textarea.getSelectionStartLine();
int stopLine = textarea.getSelectionStopLine();
// If the selection ends at the beginning of the last line,
// then don't (un)comment that line.
int lastLineStart = textarea.getLineStartOffset(stopLine);
int selectionStop = textarea.getSelectionStop();
// If the selection ends at the beginning of the last line,
// then don't (un)comment that line.
if (selectionStop == lastLineStart) {
stopLine--;
// Though if there's no selection, don't do that
if (textarea.isSelectionActive()) {
stopLine--;
}
}
// If the text is empty, ignore the user.
@@ -1217,7 +1220,10 @@ public class Editor extends JFrame {
int lastLineStart = textarea.getLineStartOffset(stopLine);
int selectionStop = textarea.getSelectionStop();
if (selectionStop == lastLineStart) {
stopLine--;
// Though if there's no selection, don't do that
if (textarea.isSelectionActive()) {
stopLine--;
}
}
for (int line = startLine; line <= stopLine; line++) {
@@ -1025,7 +1025,7 @@ public class JEditTextArea extends JComponent
* Returns the offset where the selection ends on the specified
* line.
*/
public int getSelectionEnd(int line)
public int getSelectionStop(int line)
{
if(line == selectionEndLine)
return selectionEnd;
@@ -1062,7 +1062,8 @@ public class JEditTextArea extends JComponent
{
select(selectionStart,selectionEnd);
}
public final boolean isSelectionActive()
{
return(selectionStart != selectionEnd);
+4 -4
View File
@@ -387,10 +387,10 @@ public class RawDXF extends PGraphics3D {
if (shape == POLYGON) {
for (int i = 0; i < vertexCount - 1; i++) {
writeLine(i, i+1);
}
if (mode == CLOSE) {
writeLine(vertexCount - 1, 0);
}
}
if (mode == CLOSE) {
writeLine(vertexCount - 1, 0);
}
}
/*
if ((vertexCount != 0) &&
@@ -777,6 +777,7 @@ public class PGraphicsOpenGL extends PGraphics3D {
if (raw != null) {
raw.endShape();
}
triangleCount = 0;
report("render_triangles out");
}
+4
View File
@@ -1,5 +1,9 @@
0146 pde
X fix problem with comment/uncomment and indent/outdent
X when no selection, and on the first pos of the line
_ use macosx dialogs for all of the editor stuff
_ see about doing the same on windows, linux?
_ getMessage() not sufficient for exceptions coming through
_ (it's not including the type of exception)