diff options
| author | Neil <nyamatongwe@gmail.com> | 2018-04-19 17:26:14 +1000 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2018-04-19 17:26:14 +1000 |
| commit | 8822e0ed1db342bf1947004c660a9c8649ce35c0 (patch) | |
| tree | 8756ea3c36f8319354419f0aa2d48fbf9b18eac6 /src/XPM.cxx | |
| parent | 1edfa1eaef9301aeffe31253cfc06709d4d8aae0 (diff) | |
| download | scintilla-mirror-8822e0ed1db342bf1947004c660a9c8649ce35c0.tar.gz | |
Backport: Use ColourDesired constructor explicitly to make more obvious.
Constructor not marked explicit as may be used in external platform layers.
Backport of changeset 6706:73c8bc321f62.
Diffstat (limited to 'src/XPM.cxx')
| -rw-r--r-- | src/XPM.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/XPM.cxx b/src/XPM.cxx index a446724fb..f83c3d6a8 100644 --- a/src/XPM.cxx +++ b/src/XPM.cxx @@ -89,7 +89,7 @@ void XPM::Init(const char *const *linesForm) { if (!linesForm) return; - std::fill(colourCodeTable, std::end(colourCodeTable), 0); + std::fill(colourCodeTable, std::end(colourCodeTable), ColourDesired(0)); const char *line0 = linesForm[0]; width = atoi(line0); line0 = NextField(line0); @@ -148,16 +148,16 @@ void XPM::Draw(Surface *surface, const PRectangle &rc) { void XPM::PixelAt(int x, int y, ColourDesired &colour, bool &transparent) const { if (pixels.empty() || (x<0) || (x >= width) || (y<0) || (y >= height)) { - colour = 0; + colour = ColourDesired(0); transparent = true; return; } int code = pixels[y * width + x]; transparent = code == codeTransparent; if (transparent) { - colour = 0; + colour = ColourDesired(0); } else { - colour = ColourFromCode(code).AsLong(); + colour = ColourFromCode(code); } } |
