[Fixed Position] Add tests and fix checkstyle error.

Fixes #1496
This commit is contained in:
Pegah Sarram 2017-09-13 12:08:52 -07:00
parent 68abc15ed5
commit 740db8da75
5 changed files with 17 additions and 66 deletions

View File

@ -152,68 +152,9 @@ define([
"title": "Text size",
"description": "Set text size",
"control": "select",
"options": [
{
"value": "9px",
"name": "9 px"
},
{
"value": "10px",
"name": "10 px"
},
{
"value": "11px",
"name": "11 px"
},
{
"value": "12px",
"name": "12 px"
},
{
"value": "13px",
"name": "13 px"
},
{
"value": "14px",
"name": "14 px"
},
{
"value": "15px",
"name": "15 px"
},
{
"value": "16px",
"name": "16 px"
},
{
"value": "20px",
"name": "20 px"
},
{
"value": "24px",
"name": "24 px"
},
{
"value": "30px",
"name": "30 px"
},
{
"value": "36px",
"name": "36 px"
},
{
"value": "48px",
"name": "48 px"
},
{
"value": "72px",
"name": "72 px"
},
{
"value": "96px",
"name": "96 px"
}
]
"options": [9, 10, 11, 12, 13, 14, 15, 16, 20, 24, 30, 36, 48, 72, 96].map(function (size) {
return { "name": size + " px", "value": size + "px" };
})
}
]
},

View File

@ -256,8 +256,7 @@ define(
titled: true,
width: DEFAULT_DIMENSIONS[0],
height: DEFAULT_DIMENSIONS[1],
useGrid: true,
size: "14px"
useGrid: true
});
//Re-initialize objects, and subscribe to new object

View File

@ -42,8 +42,7 @@ define(
},
"fixed.text": {
fill: "transparent",
stroke: "transparent",
size: "13px"
stroke: "transparent"
}
},
DIALOGS = {

View File

@ -67,6 +67,10 @@ define(
*/
proxy.size = new AccessorMutator(element, 'size');
if (proxy.size() === undefined) {
proxy.size("13px");
}
return proxy;
}

View File

@ -57,6 +57,14 @@ define(
expect(proxy.size('12px')).toEqual('12px');
expect(proxy.size()).toEqual('12px');
});
it("defaults to 13px for unspecified text size", function () {
testElement = {x: 1, y: 2};
proxy = new TextProxy(testElement, 0, [testElement]);
expect(proxy.size()).toEqual('13px');
});
});
}
);