@@ -183,47 +183,49 @@ namespace lsp
183
183
184
184
sFont .get_parameters (s, fscaling, &fp);
185
185
sFont .get_multitext_parameters (s, &tp, fscaling, &text);
186
+ tp.Height = lsp_max (tp.Height , fp.Height );
186
187
sIPadding .sub (&size, &sSize , scaling);
187
188
188
- // Apply text clipping
189
+ // Estimate drawing area
189
190
const bool clip = sTextClip .get ();
190
191
if (clip)
191
192
{
193
+ // Apply text clipping
192
194
r.nLeft = 0 ;
193
195
r.nTop = 0 ;
194
196
r.nWidth = sSize .nWidth ;
195
197
r.nHeight = sSize .nHeight ;
196
198
sIPadding .enter (&r, scaling);
197
199
s->clip_begin (&r);
198
200
}
199
- lsp_finally {
200
- if (clip)
201
- s->clip_end ();
202
- };
203
-
204
- // Estimate drawing area
205
- tp.Height = lsp_max (tp.Height , fp.Height );
206
- if (tp.Width <= size.nWidth )
207
- {
208
- r.nLeft = 0 ;
209
- r.nWidth = size.nWidth ;
210
- }
211
201
else
212
202
{
213
- r.nLeft = -0 .5f * (tp.Width - size.nWidth );
214
- r.nWidth = ceil (tp.Width );
215
- }
203
+ if (tp.Width <= size.nWidth )
204
+ {
205
+ r.nLeft = 0 ;
206
+ r.nWidth = size.nWidth ;
207
+ }
208
+ else
209
+ {
210
+ r.nLeft = -0 .5f * (tp.Width - size.nWidth );
211
+ r.nWidth = ceil (tp.Width );
212
+ }
216
213
217
- if (tp.Height <= size.nHeight )
218
- {
219
- r.nTop = 0 ;
220
- r.nHeight = size.nHeight ;
221
- }
222
- else
223
- {
224
- r.nTop = -0 .5f * (tp.Height - size.nHeight );
225
- r.nHeight = ceil (tp.Height );
214
+ if (tp.Height <= size.nHeight )
215
+ {
216
+ r.nTop = 0 ;
217
+ r.nHeight = size.nHeight ;
218
+ }
219
+ else
220
+ {
221
+ r.nTop = -0 .5f * (tp.Height - size.nHeight );
222
+ r.nHeight = ceil (tp.Height );
223
+ }
226
224
}
225
+ lsp_finally {
226
+ if (clip)
227
+ s->clip_end ();
228
+ };
227
229
228
230
// Initialize palette
229
231
const style::LabelColors *colors = select_colors ();
0 commit comments