Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added RTL support for labels #5769

Closed
wants to merge 13 commits into from
6 changes: 3 additions & 3 deletions Source/Scene/Label.js
Original file line number Diff line number Diff line change
@@ -87,8 +87,6 @@ define([
throw new DeveloperError('disableDepthTestDistance must be greater than 0.0.');
}
//>>includeEnd('debug');

this._text = defaultValue(options.text, '');
this._show = defaultValue(options.show, true);
this._font = defaultValue(options.font, '30px sans-serif');
this._fillColor = Color.clone(defaultValue(options.fillColor, Color.WHITE));
@@ -111,7 +109,6 @@ define([
this._heightReference = defaultValue(options.heightReference, HeightReference.NONE);
this._distanceDisplayCondition = options.distanceDisplayCondition;
this._disableDepthTestDistance = defaultValue(options.disableDepthTestDistance, 0.0);
this._rtl = defaultValue(options.rtl, false);

this._labelCollection = labelCollection;
this._glyphs = [];
@@ -126,6 +123,9 @@ define([

this._clusterShow = true;

this._rtl = defaultValue(options.rtl, false);
this.text = defaultValue(options.text, '');

this._updateClamping();
}

5 changes: 3 additions & 2 deletions Specs/Scene/LabelCollectionSpec.js
Original file line number Diff line number Diff line change
@@ -1867,9 +1867,10 @@ defineSuite([
it('should reverse text when there is only hebrew characters and rtl is true', function() {
var text = 'שלום';
var label = labels.add({
text : text
text : text,
rtl: true
});
label.rtl = true;

scene.renderForSpecs();

expect(label.rtl).toEqual(true);