@@ -195,23 +195,25 @@ void LCDPlugin::writeStringOnFrame(
195
195
const FontID fontID,
196
196
const std::string & string,
197
197
const int16_t PBMXPos,
198
- const uint16_t PBMYPos)
198
+ const int16_t PBMYPos)
199
199
{
200
200
try {
201
201
#if DEBUGGING_ON && DEBUG_LCD_PLUGINS
202
202
LOG (DEBUG2) << this ->getPluginName () << " PBM # " << _frameIndex << " - writing string : " << string;
203
203
#endif
204
- uint16_t XPos = 0 ;
205
- if ( PBMXPos < 0 ) { /* centered */
206
- XPos = pFonts->getCenteredXPos (fontID, string);
207
- }
208
- else {
209
- XPos = static_cast <uint16_t >(PBMXPos);
210
- }
204
+ uint16_t XPos, YPos = 0 ;
205
+
206
+ XPos = (PBMXPos < 0 ) ? /* centered */
207
+ pFonts->getCenteredXPos (fontID, string) :
208
+ static_cast <uint16_t >(PBMXPos);
209
+
210
+ YPos = (PBMYPos < 0 ) ? /* centered */
211
+ pFonts->getCenteredYPos (fontID) :
212
+ static_cast <uint16_t >(PBMYPos);
211
213
212
214
for (const char & c : string) {
213
215
const std::string character (1 , c);
214
- pFonts->printCharacterOnFrame ( fontID, (*_itCurrentFrame)._PBMData , character, XPos, PBMYPos );
216
+ pFonts->printCharacterOnFrame ( fontID, (*_itCurrentFrame)._PBMData , character, XPos, YPos );
215
217
} /* for each character in the string */
216
218
}
217
219
catch (const GLogiKExcept & e) {
@@ -224,7 +226,7 @@ void LCDPlugin::writeStringOnLastFrame(
224
226
const FontID fontID,
225
227
const std::string & string,
226
228
const int16_t PBMXPos,
227
- const uint16_t PBMYPos)
229
+ const int16_t PBMYPos)
228
230
{
229
231
try {
230
232
if ( _PBMFrames.empty () )
0 commit comments