Skip to content

Commit 293ae52

Browse files
committed
Code cosmetic
1 parent bc43b17 commit 293ae52

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

  • chartLib/src/main/kotlin/info/appdev/charting/components

chartLib/src/main/kotlin/info/appdev/charting/components/Legend.kt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ class Legend() : ComponentBase() {
341341
* and height of a single entry, as well as the total width and height of
342342
* the Legend.
343343
*/
344-
fun calculateDimensions(labelpaint: Paint, viewPortHandler: ViewPortHandler) {
344+
fun calculateDimensions(labelPaint: Paint, viewPortHandler: ViewPortHandler) {
345345
val defaultFormSize = formSize.convertDpToPixel()
346346
val stackSpace = stackSpace.convertDpToPixel()
347347
val formToTextSpace = formToTextSpace.convertDpToPixel()
@@ -351,15 +351,15 @@ class Legend() : ComponentBase() {
351351
val entries = this.entries
352352
val entryCount = entries.size
353353

354-
mTextWidthMax = getMaximumEntryWidth(labelpaint)
355-
mTextHeightMax = getMaximumEntryHeight(labelpaint)
354+
mTextWidthMax = getMaximumEntryWidth(labelPaint)
355+
mTextHeightMax = getMaximumEntryHeight(labelPaint)
356356

357357
when (this.orientation) {
358358
LegendOrientation.VERTICAL -> {
359359
var maxWidth = 0f
360360
var maxHeight = 0f
361361
var width = 0f
362-
val labelLineHeight = labelpaint.getLineHeight()
362+
val labelLineHeight = labelPaint.getLineHeight()
363363
var wasStacked = false
364364

365365
var i = 0
@@ -391,7 +391,7 @@ class Legend() : ComponentBase() {
391391
wasStacked = false
392392
}
393393

394-
width += labelpaint.calcTextWidth(label).toFloat()
394+
width += labelPaint.calcTextWidth(label).toFloat()
395395

396396
maxHeight += labelLineHeight + yEntrySpace
397397
} else {
@@ -409,8 +409,8 @@ class Legend() : ComponentBase() {
409409
}
410410

411411
LegendOrientation.HORIZONTAL -> {
412-
val labelLineHeight = labelpaint.getLineHeight()
413-
val labelLineSpacing = labelpaint.getLineSpacing() + yEntrySpace
412+
val labelLineHeight = labelPaint.getLineHeight()
413+
val labelLineSpacing = labelPaint.getLineSpacing() + yEntrySpace
414414
val contentWidth = viewPortHandler.contentWidth() * this.maxSizePercent
415415

416416
// Start calculating layout
@@ -425,13 +425,13 @@ class Legend() : ComponentBase() {
425425

426426
var i = 0
427427
while (i < entryCount) {
428-
val e = entries[i]
429-
val drawingForm = e.form != LegendForm.NONE
430-
val formSize = if (e.formSize.isNaN())
428+
val legendEntry = entries[i]
429+
val drawingForm = legendEntry.form != LegendForm.NONE
430+
val formSize = if (legendEntry.formSize.isNaN())
431431
defaultFormSize
432432
else
433-
e.formSize.convertDpToPixel()
434-
val label = e.label
433+
legendEntry.formSize.convertDpToPixel()
434+
val label = legendEntry.label
435435

436436
calculatedLabelBreakPoints.add(false)
437437

@@ -446,9 +446,9 @@ class Legend() : ComponentBase() {
446446

447447
// grouped forms have null labels
448448
if (label != null) {
449-
calculatedLabelSizes.add(labelpaint.calcTextSize(label))
449+
calculatedLabelSizes.add(labelPaint.calcTextSize(label))
450450
requiredWidth += if (drawingForm) formToTextSpace + formSize else 0f
451-
requiredWidth += calculatedLabelSizes.get(i).width
451+
requiredWidth += calculatedLabelSizes[i].width
452452
} else {
453453
calculatedLabelSizes.add(FSize.getInstance(0f, 0f))
454454
requiredWidth += if (drawingForm) formSize else 0f

0 commit comments

Comments
 (0)