Skip to content

FlxBitmapText does not permit negative line spacing #1984

Closed
@seraku24

Description

  • Flixel version: 4.2.0
  • OpenFL version: 3.6.1
  • Lime version: 2.9.1
  • Affected targets: flash, and (possibly) all others

Code snippet reproducing the issue:

package;

import flixel.FlxG;
import flixel.FlxState;
import flixel.text.FlxBitmapText;

class PlayState extends FlxState
{
    override public function create():Void {
        var bitmapText = new FlxBitmapText();
        var desiredLineSpacing = -5;
        bitmapText.lineSpacing = desiredLineSpacing;
        if (bitmapText.lineSpacing != desiredLineSpacing) {
            FlxG.log.error("FlxBitmapText.lineSpacing is not desired value.");
        }
    }
}

Observed behavior:
The lineSpacing property becomes a positive value, specifically the absolute value.

Expected behavior:
The lineSpacing property allows a negative value to be set.

NOTE: Near as I can tell, the text layout code in FlxBitmapText is already written properly to support a negative value for lineSpacing which would result in condensed spacing. The issue, then, lies within the property setter enforcing a positive-only value.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions