diff --git a/include/eepp/graphics/fontsprite.hpp b/include/eepp/graphics/fontsprite.hpp index 252022ed3..2632c396a 100644 --- a/include/eepp/graphics/fontsprite.hpp +++ b/include/eepp/graphics/fontsprite.hpp @@ -74,8 +74,7 @@ class EE_API FontSprite : public Font { std::string mFilePath; Uint32 mFontSize; - Glyph loadGlyph( Uint32 codePoint, unsigned int characterSize, bool bold, - Float outlineThickness ) const; + Glyph loadGlyph( Uint32 codePoint, unsigned int characterSize ) const; }; }} // namespace EE::Graphics diff --git a/src/eepp/graphics/fontsprite.cpp b/src/eepp/graphics/fontsprite.cpp index 5ad4cd118..c9746a490 100644 --- a/src/eepp/graphics/fontsprite.cpp +++ b/src/eepp/graphics/fontsprite.cpp @@ -64,7 +64,7 @@ bool FontSprite::loadFromMemory( const void* data, std::size_t sizeInBytes, Colo cleanup(); mFilePath = FileSystem::getCurrentWorkingDirectory(); IOStreamMemory stream( (const char*)data, sizeInBytes ); - return loadFromStream( stream, key, firstChar ); + return loadFromStream( stream, key, firstChar, spacing ); } bool FontSprite::loadFromStream( IOStream& stream, Color key, Uint32 firstChar, int spacing ) { @@ -163,8 +163,8 @@ const FontSprite::Info& FontSprite::getInfo() const { return mInfo; } -const Glyph& FontSprite::getGlyph( Uint32 codePoint, unsigned int characterSize, bool bold, - Float outlineThickness ) const { +const Glyph& FontSprite::getGlyph( Uint32 codePoint, unsigned int characterSize, bool, + Float ) const { GlyphTable& glyphs = mPages[characterSize].glyphs; GlyphTable::const_iterator it = glyphs.find( codePoint ); @@ -172,13 +172,12 @@ const Glyph& FontSprite::getGlyph( Uint32 codePoint, unsigned int characterSize, if ( it != glyphs.end() ) { return it->second; } else { - glyphs[characterSize] = loadGlyph( codePoint, characterSize, bold, outlineThickness ); + glyphs[characterSize] = loadGlyph( codePoint, characterSize ); return glyphs[characterSize]; } } -Glyph FontSprite::loadGlyph( Uint32 codePoint, unsigned int characterSize, bool bold, - Float outlineThickness ) const { +Glyph FontSprite::loadGlyph( Uint32 codePoint, unsigned int characterSize ) const { Glyph glyph; GlyphTable& glyphs = mPages[mFontSize].glyphs; @@ -197,7 +196,7 @@ Glyph FontSprite::loadGlyph( Uint32 codePoint, unsigned int characterSize, bool return glyph; } -Float FontSprite::getKerning( Uint32 first, Uint32 second, unsigned int characterSize ) const { +Float FontSprite::getKerning( Uint32, Uint32, unsigned int ) const { return 0; } @@ -209,15 +208,15 @@ Uint32 FontSprite::getFontHeight( const Uint32& characterSize ) { return ( Uint32 )( (Float)characterSize / mFontSize ) * mFontSize; } -Float FontSprite::getUnderlinePosition( unsigned int characterSize ) const { +Float FontSprite::getUnderlinePosition( unsigned int ) const { return 0.f; } -Float FontSprite::getUnderlineThickness( unsigned int characterSize ) const { +Float FontSprite::getUnderlineThickness( unsigned int ) const { return 0.f; } -Texture* FontSprite::getTexture( unsigned int characterSize ) const { +Texture* FontSprite::getTexture( unsigned int ) const { return mPages[mFontSize].texture; } diff --git a/src/eepp/ui/doc/syntaxdefinitionmanager.cpp b/src/eepp/ui/doc/syntaxdefinitionmanager.cpp index 559cb2f35..353e6affd 100644 --- a/src/eepp/ui/doc/syntaxdefinitionmanager.cpp +++ b/src/eepp/ui/doc/syntaxdefinitionmanager.cpp @@ -830,6 +830,19 @@ SyntaxDefinitionManager::SyntaxDefinitionManager() { {"usubpassInputMS", "keyword2"}, }, "//"} ); + + // ini / conf + add( {{"%.ini$", "%.conf$", "%.desktop$"}, + { + {{"#[%da-fA-F]+"}, "literal"}, + {{"#", "\n"}, "comment"}, + {{"\"", "\"", "\\"}, "string"}, + {{"'", "'", "\\"}, "string"}, + {{"%[", "%]"}, "keyword2"}, + {{"[%a][%w_-]*%s*%f[=]"}, "keyword"}, + {{"[=]"}, "operator"}, + {{"https?://%S+"}, "function"}, + }} ); } SyntaxDefinition& SyntaxDefinitionManager::add( SyntaxDefinition&& syntaxStyle ) { diff --git a/src/eepp/ui/uicodeeditor.cpp b/src/eepp/ui/uicodeeditor.cpp index 0ddc79b94..c2f218a25 100644 --- a/src/eepp/ui/uicodeeditor.cpp +++ b/src/eepp/ui/uicodeeditor.cpp @@ -617,7 +617,7 @@ int UICodeEditor::getVisibleLinesCount() { void UICodeEditor::scrollToMakeVisible( const TextPosition& position ) { auto lineRange = getVisibleLineRange(); - if ( position.line() < lineRange.first || position.line() > lineRange.second ) { + if ( position.line() <= lineRange.first || position.line() >= lineRange.second - 2 ) { // Vertical Scroll Float lineHeight = getLineHeight(); Float min = eefloor( lineHeight * ( eemax( 0, position.line() - 1 ) ) );