aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2000-04-21 01:59:43 +0000
committernyamatongwe <devnull@localhost>2000-04-21 01:59:43 +0000
commit6956977bdf58be27805d82c1aa33fc9d4c384241 (patch)
tree473a1082dbd214e4a3d4bb7d0b13d2aa111ee029 /src
parentcf9e0c55121fc58093e00e8aaae211ee52ecc147 (diff)
downloadscintilla-mirror-6956977bdf58be27805d82c1aa33fc9d4c384241.tar.gz
Changed font sizing to use more Windows compatible calculation
Some unfinished work on fixing folding bugs.
Diffstat (limited to 'src')
-rw-r--r--src/CellBuffer.cxx11
-rw-r--r--src/ContractionState.cxx2
-rw-r--r--src/Editor.cxx2
-rw-r--r--src/Style.cxx4
4 files changed, 14 insertions, 5 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx
index 9576e917d..0f33d48c4 100644
--- a/src/CellBuffer.cxx
+++ b/src/CellBuffer.cxx
@@ -191,11 +191,20 @@ void LineVector::InsertValue(int pos, int value) {
}
}
lines++;
- for (int i = lines + 1; i > pos; i--) {
+ for (int i = lines; i > pos; i--) {
linesData[i] = linesData[i - 1];
}
linesData[pos].startPosition = value;
linesData[pos].handleSet = 0;
+ if (levels) {
+ for (int j = lines; j > pos; j--) {
+ levels[j] = levels[j - 1];
+ }
+ if (pos == (lines-1)) // Last line will not be a folder
+ levels[pos] = SC_FOLDLEVELBASE;
+ else
+ levels[pos] = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG;
+ }
}
void LineVector::SetValue(int pos, int value) {
diff --git a/src/ContractionState.cxx b/src/ContractionState.cxx
index aedd1c3ec..b01081588 100644
--- a/src/ContractionState.cxx
+++ b/src/ContractionState.cxx
@@ -112,7 +112,7 @@ void ContractionState::InsertLines(int lineDoc, int lineCount) {
}
linesInDoc += lineCount;
linesInDisplay += lineCount;
- for (int i = linesInDoc + 1; i >= lineDoc + lineCount; i--) {
+ for (int i = linesInDoc; i >= lineDoc + lineCount; i--) {
lines[i].visible = lines[i - lineCount].visible;
lines[i].expanded = lines[i - lineCount].expanded;
}
diff --git a/src/Editor.cxx b/src/Editor.cxx
index c00f08311..440cdeff1 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1605,8 +1605,8 @@ void Editor::NotifyModified(Document*, DocModification mh, void *) {
// lineOfPos should be calculated in context of state before modification, shouldn't it
int lineOfPos = pdoc->LineFromPosition(mh.position);
if (mh.linesAdded > 0) {
- NotifyNeedShown(mh.position, mh.length);
cs.InsertLines(lineOfPos, mh.linesAdded);
+ NotifyNeedShown(mh.position, mh.length);
} else {
cs.DeleteLines(lineOfPos, -mh.linesAdded);
}
diff --git a/src/Style.cxx b/src/Style.cxx
index 47ca196f3..36d4b9850 100644
--- a/src/Style.cxx
+++ b/src/Style.cxx
@@ -89,8 +89,8 @@ void Style::Realise(Surface &surface, int zoomLevel, Style *defaultStyle) {
if (aliasOfDefaultFont)
font.SetID(0);
else
- font.Release();
- int deviceHeight = (sizeZoomed * surface.LogPixelsY()) / 72;
+ font.Release();
+ int deviceHeight = surface.DeviceHeightFont(sizeZoomed);
aliasOfDefaultFont = defaultStyle &&
(EquivalentFontTo(defaultStyle) || !fontName);
if (aliasOfDefaultFont) {