diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-02-28 09:35:08 +0000 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-02-28 09:35:08 +0000 |
commit | 30d007d8a6bd01960f9c700f69449c82b14f3835 (patch) | |
tree | b9f71897c8db9fdf2ab2659f8f0841fec60bb7e3 /scintilla/src/ViewStyle.cxx | |
parent | 35874e9a390a13de8f1b1a427a712cff3f38a0e1 (diff) | |
download | notepad2-mod-30d007d8a6bd01960f9c700f69449c82b14f3835.zip notepad2-mod-30d007d8a6bd01960f9c700f69449c82b14f3835.tar.gz notepad2-mod-30d007d8a6bd01960f9c700f69449c82b14f3835.tar.bz2 |
update scintilla
git-svn-id: https://notepad2-mod.googlecode.com/svn/trunk@715 28bd50df-7adb-d945-0439-6e466c6a13cc
Diffstat (limited to 'scintilla/src/ViewStyle.cxx')
-rw-r--r-- | scintilla/src/ViewStyle.cxx | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/scintilla/src/ViewStyle.cxx b/scintilla/src/ViewStyle.cxx index 882decc..f7357b1 100644 --- a/scintilla/src/ViewStyle.cxx +++ b/scintilla/src/ViewStyle.cxx @@ -145,6 +145,7 @@ ViewStyle::ViewStyle(const ViewStyle &source) { for (int mrk=0; mrk<=MARKER_MAX; mrk++) {
markers[mrk] = source.markers[mrk];
}
+ CalcLargestMarkerHeight();
for (int ind=0; ind<=INDIC_MAX; ind++) {
indicators[ind] = source.indicators[ind];
}
@@ -194,7 +195,6 @@ ViewStyle::ViewStyle(const ViewStyle &source) { for (int i=0; i < margins; i++) {
ms[i] = source.ms[i];
}
- symbolMargin = source.symbolMargin;
maskInLine = source.maskInLine;
fixedColumnWidth = source.fixedColumnWidth;
zoomLevel = source.zoomLevel;
@@ -230,6 +230,9 @@ void ViewStyle::Init(size_t stylesSize_) { fontNames.Clear();
ResetDefaultStyle();
+ // There are no image markers by default, so no need for calling CalcLargestMarkerHeight()
+ largestMarkerHeight = 0;
+
indicators[0].style = INDIC_SQUIGGLE;
indicators[0].under = false;
indicators[0].fore = ColourDesired(0, 0x7f, 0);
@@ -302,11 +305,9 @@ void ViewStyle::Init(size_t stylesSize_) { ms[2].width = 0;
ms[2].mask = 0;
fixedColumnWidth = leftMarginWidth;
- symbolMargin = false;
maskInLine = 0xffffffff;
for (int margin=0; margin < margins; margin++) {
fixedColumnWidth += ms[margin].width;
- symbolMargin = symbolMargin || (ms[margin].style != SC_MARGIN_NUMBER);
if (ms[margin].width > 0)
maskInLine &= ~ms[margin].mask;
}
@@ -385,11 +386,9 @@ void ViewStyle::Refresh(Surface &surface) { spaceWidth = styles[STYLE_DEFAULT].spaceWidth;
fixedColumnWidth = leftMarginWidth;
- symbolMargin = false;
maskInLine = 0xffffffff;
for (int margin=0; margin < margins; margin++) {
fixedColumnWidth += ms[margin].width;
- symbolMargin = symbolMargin || (ms[margin].style != SC_MARGIN_NUMBER);
if (ms[margin].width > 0)
maskInLine &= ~ms[margin].mask;
}
@@ -457,3 +456,19 @@ bool ViewStyle::ValidStyle(size_t styleIndex) const { return styleIndex < stylesSize;
}
+void ViewStyle::CalcLargestMarkerHeight() {
+ largestMarkerHeight = 0;
+ for (int m = 0; m <= MARKER_MAX; ++m) {
+ switch (markers[m].markType) {
+ case SC_MARK_PIXMAP:
+ if (markers[m].pxpm->GetHeight() > largestMarkerHeight)
+ largestMarkerHeight = markers[m].pxpm->GetHeight();
+ break;
+ case SC_MARK_RGBAIMAGE:
+ if (markers[m].image->GetHeight() > largestMarkerHeight)
+ largestMarkerHeight = markers[m].image->GetHeight();
+ break;
+ }
+ }
+}
+
|