Skip to content

Commit

Permalink
Merge branch 'master' into ajd/update-formatting-more
Browse files Browse the repository at this point in the history
  • Loading branch information
ajduberstein committed Sep 4, 2020
2 parents d952378 + 703ca20 commit 0a57fcf
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bindings/pydeck/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def run(self):
long_description_content_type="text/markdown",
license="Apache 2.0 License",
include_package_data=True,
packages=find_packages(exclude=["test"]),
packages=find_packages(exclude=["tests*"]),
cmdclass={
"install": install,
"develop": js_prerelease(ExitHookDevelop),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const EMPTY_ARRAY = [];

const defaultProps = {
backgroundColor: {type: 'color', value: null, optional: true},
getIconOffsets: {type: 'accessor', value: x => x.offsets}
getIconOffsets: {type: 'accessor', value: x => x.offsets},
alphaCutoff: 0
};

export default class MultiIconLayer extends IconLayer {
Expand Down
4 changes: 2 additions & 2 deletions modules/layers/src/text-layer/text-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export default class TextLayer extends CompositeLayer {
getAngle,
getPixelOffset,
billboard,
sdf,
fontSettings,
sizeScale,
sizeUnits,
sizeMinPixels,
Expand All @@ -274,7 +274,7 @@ export default class TextLayer extends CompositeLayer {

return new SubLayerClass(
{
sdf,
sdf: fontSettings.sdf,
iconAtlas: texture,
iconMapping: mapping,
backgroundColor,
Expand Down
30 changes: 30 additions & 0 deletions test/modules/layers/text-layer/text-layer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,36 @@ test('TextLayer', t => {
t.end();
});

test('TextLayer - sdf', t => {
const testCases = [
{
props: {
data: FIXTURES.points,
getText: d => d.ADDRESS,
getPosition: d => d.COORDINATES
},
onAfterUpdate: ({subLayer}) => {
t.notOk(subLayer.props.sdf, 'sublayer props.sdf');
t.is(subLayer.props.alphaCutoff, 0, 'sublayer props.alphaCutoff');
}
},
{
updateProps: {
fontSettings: {
sdf: true,
buffer: 10
}
},
onAfterUpdate: ({subLayer}) => {
t.ok(subLayer.props.sdf, 'sublayer props.sdf');
}
}
];
testLayer({Layer: TextLayer, testCases, onError: t.notOk});

t.end();
});

test('TextLayer - binary', t => {
const value = new Uint8Array([72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 33]);
const startIndices = [0, 6];
Expand Down

0 comments on commit 0a57fcf

Please sign in to comment.