[geany/geany] 654f07: Update Scintilla to version 3.2.2
Colomban Wendling
git-noreply at xxxxx
Tue Sep 4 22:37:41 UTC 2012
Branch: refs/heads/master
Author: Colomban Wendling <ban at herbesfolles.org>
Committer: Colomban Wendling <ban at herbesfolles.org>
Date: Tue, 04 Sep 2012 22:37:41
Commit: 654f07219f112f3c487675ceb70afda766684a81
https://github.com/geany/geany/commit/654f07219f112f3c487675ceb70afda766684a81
Log Message:
-----------
Update Scintilla to version 3.2.2
Modified Paths:
--------------
NEWS
scintilla/gtk/PlatGTK.cxx
scintilla/include/Platform.h
scintilla/include/Scintilla.h
scintilla/include/Scintilla.iface
scintilla/lexers/LexHTML.cxx
scintilla/lexers/LexLua.cxx
scintilla/lexers/LexOthers.cxx
scintilla/lexers/LexYAML.cxx
scintilla/src/AutoComplete.cxx
scintilla/src/AutoComplete.h
scintilla/src/CallTip.cxx
scintilla/src/CallTip.h
scintilla/src/Editor.cxx
scintilla/src/Editor.h
scintilla/src/Indicator.cxx
scintilla/src/LineMarker.cxx
scintilla/src/LineMarker.h
scintilla/src/ScintillaBase.cxx
scintilla/src/XPM.cxx
scintilla/src/XPM.h
scintilla/version.txt
Modified: NEWS
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -1,7 +1,7 @@
Geany 1.23 (unreleased)
Editor
- * Update Scintilla to version 3.2.1 (#3540469).
+ * Update Scintilla to version 3.2.2 (#3540469).
Search
* 'Mark All' now also uses the fully-featured PCRE engine (#3564132).
Modified: scintilla/gtk/PlatGTK.cxx
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -1858,7 +1858,7 @@ void ListBoxX::RegisterImage(int type, const char *xpm_data) {
}
void ListBoxX::RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) {
- RegisterRGBA(type, new RGBAImage(width, height, pixelsImage));
+ RegisterRGBA(type, new RGBAImage(width, height, 1.0, pixelsImage));
}
void ListBoxX::ClearRegisteredImages() {
Modified: scintilla/include/Platform.h
5 files changed, 5 insertions(+), 0 deletions(-)
===================================================================
@@ -22,6 +22,7 @@
#define PLAT_WX 0
#define PLAT_QT 0
#define PLAT_FOX 0
+#define PLAT_NCURSES 0
#if defined(FOX)
#undef PLAT_FOX
@@ -31,6 +32,10 @@
#undef PLAT_WX
#define PLAT_WX 1
+#elif defined(NCURSES)
+#undef PLAT_NCURSES
+#define PLAT_NCURSES 1
+
#elif defined(SCINTILLA_QT)
#undef PLAT_QT
#define PLAT_QT 1
Modified: scintilla/include/Scintilla.h
5 files changed, 5 insertions(+), 0 deletions(-)
===================================================================
@@ -262,6 +262,7 @@
#define INDIC_DOTS 10
#define INDIC_SQUIGGLELOW 11
#define INDIC_DOTBOX 12
+#define INDIC_SQUIGGLEPIXMAP 13
#define INDIC_MAX 31
#define INDIC_CONTAINER 8
#define INDIC0_MASK 0x20
@@ -787,6 +788,7 @@
#define SCI_SETADDITIONALCARETSVISIBLE 2608
#define SCI_GETADDITIONALCARETSVISIBLE 2609
#define SCI_GETSELECTIONS 2570
+#define SCI_GETSELECTIONEMPTY 2650
#define SCI_CLEARSELECTIONS 2571
#define SCI_SETSELECTION 2572
#define SCI_ADDSELECTION 2573
@@ -836,6 +838,7 @@
#define SCI_GETIDENTIFIER 2623
#define SCI_RGBAIMAGESETWIDTH 2624
#define SCI_RGBAIMAGESETHEIGHT 2625
+#define SCI_RGBAIMAGESETSCALE 2651
#define SCI_MARKERDEFINERGBAIMAGE 2626
#define SCI_REGISTERRGBAIMAGE 2627
#define SCI_SCROLLTOSTART 2628
@@ -848,6 +851,8 @@
#define SCI_FINDINDICATORSHOW 2640
#define SCI_FINDINDICATORFLASH 2641
#define SCI_FINDINDICATORHIDE 2642
+#define SCI_VCHOMEDISPLAY 2652
+#define SCI_VCHOMEDISPLAYEXTEND 2653
#define SCI_STARTRECORD 3001
#define SCI_STOPRECORD 3002
#define SCI_SETLEXER 4001
Modified: scintilla/include/Scintilla.iface
14 files changed, 14 insertions(+), 0 deletions(-)
===================================================================
@@ -578,6 +578,7 @@ val INDIC_DASH=9
val INDIC_DOTS=10
val INDIC_SQUIGGLELOW=11
val INDIC_DOTBOX=12
+val INDIC_SQUIGGLEPIXMAP=13
val INDIC_MAX=31
val INDIC_CONTAINER=8
val INDIC0_MASK=0x20
@@ -2100,6 +2101,9 @@ get bool GetAdditionalCaretsVisible=2609(,)
# How many selections are there?
get int GetSelections=2570(,)
+# Is every selected range empty?
+get bool GetSelectionEmpty=2650(,)
+
# Clear selections to a single empty stream selection
fun void ClearSelections=2571(,)
@@ -2218,6 +2222,9 @@ set void RGBAImageSetWidth=2624(int width,)
# Set the height for future RGBA image data.
set void RGBAImageSetHeight=2625(int height,)
+# Set the scale factor in percent for future RGBA image data.
+set void RGBAImageSetScale=2651(int scalePercent,)
+
# Define a marker from RGBA data.
# It has the width and height from RGBAImageSetWidth/Height
fun void MarkerDefineRGBAImage=2626(int markerNumber, string pixels)
@@ -2253,6 +2260,13 @@ fun void FindIndicatorFlash=2641(position start, position end)
# On OS X, hide the find indicator.
fun void FindIndicatorHide=2642(,)
+# Move caret to before first visible character on display line.
+# If already there move to first character on display line.
+fun void VCHomeDisplay=2652(,)
+
+# Like VCHomeDisplay but extending selection to new caret position.
+fun void VCHomeDisplayExtend=2653(,)
+
# Start notifying the container of all key presses and commands.
fun void StartRecord=3001(,)
Modified: scintilla/lexers/LexHTML.cxx
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -297,7 +297,7 @@ static int classifyTagHTML(unsigned int start, unsigned int end,
if (allowScripts && 0 == strcmp(s, "script")) {
// check to see if this is a self-closing tag by sniffing ahead
bool isSelfClose = false;
- for (unsigned int cPos = end; cPos <= end + 100; cPos++) {
+ for (unsigned int cPos = end; cPos <= end + 200; cPos++) {
char ch = styler.SafeGetCharAt(cPos, '\0');
if (ch == '\0' || ch == '>')
break;
Modified: scintilla/lexers/LexLua.cxx
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -374,7 +374,6 @@ static void FoldLuaDoc(unsigned int startPos, int length, int /* initStyle */, W
char chNext = styler[startPos];
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
int styleNext = styler.StyleAt(startPos);
- char s[10];
for (unsigned int i = startPos; i < lengthDoc; i++) {
char ch = chNext;
@@ -384,6 +383,7 @@ static void FoldLuaDoc(unsigned int startPos, int length, int /* initStyle */, W
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
if (style == SCE_LUA_WORD) {
if (ch == 'i' || ch == 'd' || ch == 'f' || ch == 'e' || ch == 'r' || ch == 'u') {
+ char s[10] = "";
for (unsigned int j = 0; j < 8; j++) {
if (!iswordchar(styler[i + j])) {
break;
Modified: scintilla/lexers/LexOthers.cxx
20 files changed, 11 insertions(+), 9 deletions(-)
===================================================================
@@ -560,7 +560,7 @@ static void ColouriseDiffLine(char *lineBuffer, int endLine, Accessor &styler) {
}
static void ColouriseDiffDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
- char lineBuffer[DIFF_BUFFER_START_SIZE];
+ char lineBuffer[DIFF_BUFFER_START_SIZE] = "";
styler.StartAt(startPos);
styler.StartSegment(startPos);
unsigned int linePos = 0;
@@ -857,17 +857,19 @@ static void ColouriseMakeLine(
while ((i < lengthLine) && isspacechar(lineBuffer[i])) {
i++;
}
- if (lineBuffer[i] == '#') { // Comment
- styler.ColourTo(endPos, SCE_MAKE_COMMENT);
- return;
- }
- if (lineBuffer[i] == '!') { // Special directive
- styler.ColourTo(endPos, SCE_MAKE_PREPROCESSOR);
- return;
+ if (i < lengthLine) {
+ if (lineBuffer[i] == '#') { // Comment
+ styler.ColourTo(endPos, SCE_MAKE_COMMENT);
+ return;
+ }
+ if (lineBuffer[i] == '!') { // Special directive
+ styler.ColourTo(endPos, SCE_MAKE_PREPROCESSOR);
+ return;
+ }
}
int varCount = 0;
while (i < lengthLine) {
- if (lineBuffer[i] == '$' && lineBuffer[i + 1] == '(') {
+ if (((i + 1) < lengthLine) && (lineBuffer[i] == '$' && lineBuffer[i + 1] == '(')) {
styler.ColourTo(startLine + i - 1, state);
state = SCE_MAKE_IDENTIFIER;
varCount++;
Modified: scintilla/lexers/LexYAML.cxx
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -169,7 +169,7 @@ static void ColouriseYAMLLine(
}
static void ColouriseYAMLDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler) {
- char lineBuffer[1024];
+ char lineBuffer[1024] = "";
styler.StartAt(startPos);
styler.StartSegment(startPos);
unsigned int linePos = 0;
Modified: scintilla/src/AutoComplete.cxx
4 files changed, 3 insertions(+), 1 deletions(-)
===================================================================
@@ -34,7 +34,9 @@
cancelAtStartPos(true),
autoHide(true),
dropRestOfWord(false),
- ignoreCaseBehaviour(SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE) {
+ ignoreCaseBehaviour(SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE),
+ widthLBDefault(100),
+ heightLBDefault(100) {
lb = ListBox::Allocate();
stopChars[0] = '\0';
fillUpChars[0] = '\0';
Modified: scintilla/src/AutoComplete.h
2 files changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -34,6 +34,8 @@ class AutoComplete {
bool autoHide;
bool dropRestOfWord;
unsigned int ignoreCaseBehaviour;
+ int widthLBDefault;
+ int heightLBDefault;
AutoComplete();
~AutoComplete();
Modified: scintilla/src/CallTip.cxx
18 files changed, 10 insertions(+), 8 deletions(-)
===================================================================
@@ -18,9 +18,6 @@
using namespace Scintilla;
#endif
-static const int insetX = 5; // text inset in x from calltip border
-static const int widthArrow = 14;
-
CallTip::CallTip() {
wCallTip = 0;
inCallTipMode = false;
@@ -36,6 +33,11 @@
above = false;
useStyleCallTip = false; // for backwards compatibility
+ insetX = 5;
+ widthArrow = 14;
+ borderHeight = 2; // Extra line for border and an empty line at top and bottom.
+ verticalOffset = 1;
+
#ifdef __APPLE__
// proper apple colours for the default
colourBG = ColourDesired(0xff, 0xff, 0xc6);
@@ -284,15 +286,15 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, int textHeight, const char *
}
lineHeight = surfaceMeasure->Height(font);
- // Extra line for border and an empty line at top and bottom. The returned
+ // The returned
// rectangle is aligned to the right edge of the last arrow encountered in
// the tip text, else to the tip text left edge.
- int height = lineHeight * numLines - surfaceMeasure->InternalLeading(font) + 2 + 2;
+ int height = lineHeight * numLines - surfaceMeasure->InternalLeading(font) + borderHeight * 2;
delete surfaceMeasure;
if (above) {
- return PRectangle(pt.x - offsetMain, pt.y - 1 - height, pt.x + width - offsetMain, pt.y - 1);
+ return PRectangle(pt.x - offsetMain, pt.y - verticalOffset - height, pt.x + width - offsetMain, pt.y - verticalOffset);
} else {
- return PRectangle(pt.x - offsetMain, pt.y + 1 + textHeight, pt.x + width - offsetMain, pt.y + 1 + textHeight + height);
+ return PRectangle(pt.x - offsetMain, pt.y + verticalOffset + textHeight, pt.x + width - offsetMain, pt.y + verticalOffset + textHeight + height);
}
}
@@ -307,7 +309,7 @@ void CallTip::SetHighlight(int start, int end) {
// Avoid flashing by checking something has really changed
if ((start != startHighlight) || (end != endHighlight)) {
startHighlight = start;
- endHighlight = end;
+ endHighlight = (end > start) ? end : start;
if (wCallTip.Created()) {
wCallTip.InvalidateAll();
}
Modified: scintilla/src/CallTip.h
5 files changed, 5 insertions(+), 0 deletions(-)
===================================================================
@@ -50,6 +50,11 @@ class CallTip {
int codePage;
int clickPlace;
+ int insetX; // text inset in x from calltip border
+ int widthArrow;
+ int borderHeight;
+ int verticalOffset; // pixel offset up or down of the calltip with respect to the line
+
CallTip();
~CallTip();
Modified: scintilla/src/Editor.cxx
50 files changed, 43 insertions(+), 7 deletions(-)
===================================================================
@@ -104,6 +104,7 @@ static inline bool IsAllSpacesOrTabs(char *s, unsigned int len) {
stylesValid = false;
technology = SC_TECHNOLOGY_DEFAULT;
+ scaleRGBAImage = 100;
printMagnification = 0;
printColourMode = SC_PRINT_NORMAL;
@@ -217,6 +218,9 @@ static inline bool IsAllSpacesOrTabs(char *s, unsigned int len) {
convertPastes = true;
+ marginNumberPadding = 3;
+ ctrlCharPadding = 3; // +3 For a blank on front and rounded edge each side
+
hsStart = -1;
hsEnd = -1;
@@ -1956,7 +1960,7 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
PRectangle rcNumber = rcMarker;
// Right justify
XYPOSITION width = surface->WidthText(vs.styles[STYLE_LINENUMBER].font, number, istrlen(number));
- XYPOSITION xpos = rcNumber.right - width - 3;
+ XYPOSITION xpos = rcNumber.right - width - marginNumberPadding;
rcNumber.left = xpos;
surface->DrawTextNoClip(rcNumber, vs.styles[STYLE_LINENUMBER].font,
rcNumber.top + vs.maxAscent, number, istrlen(number),
@@ -2198,9 +2202,8 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou
} else if (controlCharSymbol < 32) {
if (ctrlCharWidth[ll->chars[charInLine]] == 0) {
const char *ctrlChar = ControlCharacterString(ll->chars[charInLine]);
- // +3 For a blank on front and rounded edge each side:
ctrlCharWidth[ll->chars[charInLine]] =
- surface->WidthText(ctrlCharsFont, ctrlChar, istrlen(ctrlChar)) + 3;
+ surface->WidthText(ctrlCharsFont, ctrlChar, istrlen(ctrlChar)) + ctrlCharPadding;
}
ll->positions[charInLine + 1] = ctrlCharWidth[ll->chars[charInLine]];
} else {
@@ -4317,10 +4320,12 @@ void Editor::DelCharBack(bool allowLineStartDeletion) {
sel.Range(r).ClearVirtualSpace();
}
}
+ ThinRectangularRange();
} else {
ClearSelection();
}
sel.RemoveDuplicates();
+ ContainerNeedsUpdate(SC_UPDATE_SELECTION);
// Avoid blinking during rapid typing:
ShowCaretAtCurrentPosition();
}
@@ -4759,6 +4764,8 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lPar
case SCI_VCHOMEEXTEND:
case SCI_VCHOMEWRAP:
case SCI_VCHOMEWRAPEXTEND:
+ case SCI_VCHOMEDISPLAY:
+ case SCI_VCHOMEDISPLAYEXTEND:
case SCI_DELWORDLEFT:
case SCI_DELWORDRIGHT:
case SCI_DELWORDRIGHTEND:
@@ -5553,11 +5560,31 @@ int Editor::KeyCommand(unsigned int iMessage) {
StartEndDisplayLine(sel.MainCaret(), true), -1));
SetLastXChosen();
break;
+ case SCI_VCHOMEDISPLAY: {
+ SelectionPosition homePos = SelectionPosition(pdoc->VCHomePosition(sel.MainCaret()));
+ SelectionPosition viewLineStart = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), true), -1);
+ if (viewLineStart > homePos)
+ homePos = viewLineStart;
+
+ MovePositionTo(homePos);
+ SetLastXChosen();
+ }
+ break;
case SCI_HOMEDISPLAYEXTEND:
MovePositionTo(MovePositionSoVisible(
StartEndDisplayLine(sel.MainCaret(), true), -1), Selection::selStream);
SetLastXChosen();
break;
+ case SCI_VCHOMEDISPLAYEXTEND: {
+ SelectionPosition homePos = SelectionPosition(pdoc->VCHomePosition(sel.MainCaret()));
+ SelectionPosition viewLineStart = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), true), -1);
+ if (viewLineStart > homePos)
+ homePos = viewLineStart;
+
+ MovePositionTo(homePos, Selection::selStream);
+ SetLastXChosen();
+ }
+ break;
case SCI_LINEENDDISPLAY:
MovePositionTo(MovePositionSoVisible(
StartEndDisplayLine(sel.MainCaret(), false), 1));
@@ -5887,11 +5914,11 @@ void Editor::CopySelectionRange(SelectionText *ss, bool allowLineCopy) {
char *textWithEndl = new char[textLen];
textWithEndl[0] = '\0';
if (text)
- strncat(textWithEndl, text, textLen);
+ strcat(textWithEndl, text);
if (pdoc->eolMode != SC_EOL_LF)
- strncat(textWithEndl, "\r", textLen);
+ strcat(textWithEndl, "\r");
if (pdoc->eolMode != SC_EOL_CR)
- strncat(textWithEndl, "\n", textLen);
+ strcat(textWithEndl, "\n");
ss->Set(textWithEndl, static_cast<int>(strlen(textWithEndl) + 1),
pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, true);
delete []text;
@@ -8157,9 +8184,13 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
sizeRGBAImage.y = wParam;
break;
+ case SCI_RGBAIMAGESETSCALE:
+ scaleRGBAImage = wParam;
+ break;
+
case SCI_MARKERDEFINERGBAIMAGE:
if (wParam <= MARKER_MAX) {
- vs.markers[wParam].SetRGBAImage(sizeRGBAImage, reinterpret_cast<unsigned char *>(lParam));
+ vs.markers[wParam].SetRGBAImage(sizeRGBAImage, scaleRGBAImage / 100.0, reinterpret_cast<unsigned char *>(lParam));
vs.CalcLargestMarkerHeight();
};
InvalidateStyleData();
@@ -8639,6 +8670,8 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_VCHOMEEXTEND:
case SCI_VCHOMEWRAP:
case SCI_VCHOMEWRAPEXTEND:
+ case SCI_VCHOMEDISPLAY:
+ case SCI_VCHOMEDISPLAYEXTEND:
case SCI_ZOOMIN:
case SCI_ZOOMOUT:
case SCI_DELWORDLEFT:
@@ -9145,6 +9178,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_GETSELECTIONS:
return sel.Count();
+ case SCI_GETSELECTIONEMPTY:
+ return sel.Empty();
+
case SCI_CLEARSELECTIONS:
sel.Clear();
Redraw();
Modified: scintilla/src/Editor.h
4 files changed, 4 insertions(+), 0 deletions(-)
===================================================================
@@ -133,6 +133,7 @@ class Editor : public DocWatcher {
ViewStyle vs;
int technology;
Point sizeRGBAImage;
+ float scaleRGBAImage;
int printMagnification;
int printColourMode;
@@ -268,6 +269,9 @@ class Editor : public DocWatcher {
bool convertPastes;
+ int marginNumberPadding; // the right-side padding of the number margin
+ int ctrlCharPadding; // the padding around control character text blobs
+
Document *pdoc;
Editor();
Modified: scintilla/src/Indicator.cxx
51 files changed, 40 insertions(+), 11 deletions(-)
===================================================================
@@ -18,19 +18,49 @@
using namespace Scintilla;
#endif
+static PRectangle PixelGridAlign(const PRectangle &rc) {
+ // Move left and right side to nearest pixel to avoid blurry visuals
+ return PRectangle(int(rc.left + 0.5), rc.top, int(rc.right + 0.5), rc.bottom);
+}
+
void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine) {
surface->PenColour(fore);
int ymid = (rc.bottom + rc.top) / 2;
if (style == INDIC_SQUIGGLE) {
- surface->MoveTo(rc.left, rc.top);
- int x = rc.left + 2;
- int y = 2;
- while (x < rc.right) {
+ int x = int(rc.left+0.5);
+ int xLast = int(rc.right+0.5);
+ int y = 0;
+ surface->MoveTo(x, rc.top + y);
+ while (x < xLast) {
+ if ((x + 2) > xLast) {
+ if (xLast > x)
+ y = 1;
+ x = xLast;
+ } else {
+ x += 2;
+ y = 2 - y;
+ }
surface->LineTo(x, rc.top + y);
- x += 2;
- y = 2 - y;
}
- surface->LineTo(rc.right, rc.top + y); // Finish the line
+ } else if (style == INDIC_SQUIGGLEPIXMAP) {
+ PRectangle rcSquiggle = PixelGridAlign(rc);
+
+ int width = Platform::Minimum(4000, rcSquiggle.Width());
+ RGBAImage image(width, 3, 1.0, 0);
+ enum { alphaFull = 0xff, alphaSide = 0x2f, alphaSide2=0x5f };
+ for (int x = 0; x < width; x++) {
+ if (x%2) {
+ // Two halfway columns have a full pixel in middle flanked by light pixels
+ image.SetPixel(x, 0, fore, alphaSide);
+ image.SetPixel(x, 1, fore, alphaFull);
+ image.SetPixel(x, 2, fore, alphaSide);
+ } else {
+ // Extreme columns have a full pixel at bottom or top and a mid-tone pixel in centre
+ image.SetPixel(x, (x%4) ? 0 : 2, fore, alphaFull);
+ image.SetPixel(x, 1, fore, alphaSide2);
+ }
+ }
+ surface->DrawRGBAImage(rcSquiggle, image.GetWidth(), image.GetHeight(), image.Pixels());
} else if (style == INDIC_SQUIGGLELOW) {
surface->MoveTo(rc.left, rc.top);
int x = rc.left + 3;
@@ -89,13 +119,12 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
rcBox.right = rc.right;
surface->AlphaRectangle(rcBox, (style == INDIC_ROUNDBOX) ? 1 : 0, fore, fillAlpha, fore, outlineAlpha, 0);
} else if (style == INDIC_DOTBOX) {
- PRectangle rcBox = rcLine;
+ PRectangle rcBox = PixelGridAlign(rc);
rcBox.top = rcLine.top + 1;
- rcBox.left = rc.left;
- rcBox.right = rc.right;
+ rcBox.bottom = rcLine.bottom;
// Cap width at 4000 to avoid large allocations when mistakes made
int width = Platform::Minimum(rcBox.Width(), 4000);
- RGBAImage image(width, rcBox.Height(), 0);
+ RGBAImage image(width, rcBox.Height(), 1.0, 0);
// Draw horizontal lines top and bottom
for (int x=0; x<width; x++) {
for (int y=0; y<rcBox.Height(); y += rcBox.Height()-1) {
Modified: scintilla/src/LineMarker.cxx
12 files changed, 6 insertions(+), 6 deletions(-)
===================================================================
@@ -32,9 +32,9 @@ void LineMarker::SetXPM(const char *const *linesForm) {
markType = SC_MARK_PIXMAP;
}
-void LineMarker::SetRGBAImage(Point sizeRGBAImage, const unsigned char *pixelsRGBAImage) {
+void LineMarker::SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage) {
delete image;
- image = new RGBAImage(sizeRGBAImage.x, sizeRGBAImage.y, pixelsRGBAImage);
+ image = new RGBAImage(sizeRGBAImage.x, sizeRGBAImage.y, scale, pixelsRGBAImage);
markType = SC_MARK_RGBAIMAGE;
}
@@ -99,10 +99,10 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
if ((markType == SC_MARK_RGBAIMAGE) && (image)) {
// Make rectangle just large enough to fit image centred on centre of rcWhole
PRectangle rcImage;
- rcImage.top = static_cast<int>(((rcWhole.top + rcWhole.bottom) - image->GetHeight()) / 2);
- rcImage.bottom = rcImage.top + image->GetHeight();
- rcImage.left = static_cast<int>(((rcWhole.left + rcWhole.right) - image->GetWidth()) / 2);
- rcImage.right = rcImage.left + image->GetWidth();
+ rcImage.top = static_cast<int>(((rcWhole.top + rcWhole.bottom) - image->GetScaledHeight()) / 2);
+ rcImage.bottom = rcImage.top + image->GetScaledHeight();
+ rcImage.left = static_cast<int>(((rcWhole.left + rcWhole.right) - image->GetScaledWidth()) / 2);
+ rcImage.right = rcImage.left + image->GetScaledWidth();
surface->DrawRGBAImage(rcImage, image->GetWidth(), image->GetHeight(), image->Pixels());
return;
}
Modified: scintilla/src/LineMarker.h
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -66,7 +66,7 @@ class LineMarker {
}
void SetXPM(const char *textForm);
void SetXPM(const char *const *linesForm);
- void SetRGBAImage(Point sizeRGBAImage, const unsigned char *pixelsRGBAImage);
+ void SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage);
void Draw(Surface *surface, PRectangle &rc, Font &fontForCharacter, typeOfFold tFold, int marginStyle);
};
Modified: scintilla/src/ScintillaBase.cxx
4 files changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -226,8 +226,8 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
if (rcPopupBounds.Height() == 0)
rcPopupBounds = rcClient;
- int heightLB = 100;
- int widthLB = 100;
+ int heightLB = ac.heightLBDefault;
+ int widthLB = ac.widthLBDefault;
if (pt.x >= rcClient.right - widthLB) {
HorizontalScrollTo(xOffset + pt.x - rcClient.right + widthLB);
Redraw();
Modified: scintilla/src/XPM.cxx
13 files changed, 7 insertions(+), 6 deletions(-)
===================================================================
@@ -319,8 +319,8 @@ int XPMSet::GetWidth() {
return (width > 0) ? width : 0;
}
-RGBAImage::RGBAImage(int width_, int height_, const unsigned char *pixels_) :
- height(height_), width(width_) {
+RGBAImage::RGBAImage(int width_, int height_, float scale_, const unsigned char *pixels_) :
+ height(height_), width(width_), scale(scale_) {
if (pixels_) {
pixelBytes.assign(pixels_, pixels_ + CountBytes());
} else {
@@ -331,6 +331,7 @@ int XPMSet::GetWidth() {
RGBAImage::RGBAImage(const XPM &xpm) {
height = xpm.GetHeight();
width = xpm.GetWidth();
+ scale = 1;
pixelBytes.resize(CountBytes());
for (int y=0; y<height; y++) {
for (int x=0; x<width; x++) {
@@ -356,10 +357,10 @@ const unsigned char *RGBAImage::Pixels() const {
void RGBAImage::SetPixel(int x, int y, ColourDesired colour, int alpha) {
unsigned char *pixel = &pixelBytes[0] + (y*width+x) * 4;
// RGBA
- pixel[0] = colour.GetRed();
- pixel[1] = colour.GetGreen();
- pixel[2] = colour.GetBlue();
- pixel[3] = alpha;
+ pixel[0] = static_cast<unsigned char>(colour.GetRed());
+ pixel[1] = static_cast<unsigned char>(colour.GetGreen());
+ pixel[2] = static_cast<unsigned char>(colour.GetBlue());
+ pixel[3] = static_cast<unsigned char>(alpha);
}
RGBAImageSet::RGBAImageSet() : height(-1), width(-1){
Modified: scintilla/src/XPM.h
6 files changed, 5 insertions(+), 1 deletions(-)
===================================================================
@@ -80,13 +80,17 @@ class RGBAImage {
RGBAImage &operator=(const RGBAImage &);
int height;
int width;
+ float scale;
std::vector<unsigned char> pixelBytes;
public:
- RGBAImage(int width_, int height_, const unsigned char *pixels_);
+ RGBAImage(int width_, int height_, float scale_, const unsigned char *pixels_);
RGBAImage(const XPM &xpm);
virtual ~RGBAImage();
int GetHeight() const { return height; }
int GetWidth() const { return width; }
+ float GetScale() const { return scale; }
+ float GetScaledHeight() const { return height / scale; }
+ float GetScaledWidth() const { return width / scale; }
int CountBytes() const;
const unsigned char *Pixels() const;
void SetPixel(int x, int y, ColourDesired colour, int alpha=0xff);
Modified: scintilla/version.txt
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -1 +1 @@
-321
+322
@@ Diff output truncated at 100000 characters. @@
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
More information about the Commits
mailing list