Stylistic changes to pixel and pen size code.

This commit is contained in:
Smie 2016-11-28 08:21:30 -07:00
parent a65eeee2e0
commit da0e8dec84
4 changed files with 13 additions and 12 deletions

View file

@ -16,17 +16,17 @@
}
.pen-size-option[data-size='1'] {
padding: 6px;
}
.pen-size-option[data-size='2'] {
padding: 5px;
}
.pen-size-option[data-size='3'] {
.pen-size-option[data-size='2'] {
padding: 4px;
}
.pen-size-option[data-size='4'] {
.pen-size-option[data-size='3'] {
padding: 3px;
}
.pen-size-option[data-size='4'] {
padding: 2px;
}
.pen-size-option:before {
content: '';
@ -34,6 +34,9 @@
height: 100%;
background-color: white;
display: block;
text-align: center;
line-height: 12px;
font-size: 90%;
}
.pen-size-option:hover {

View file

@ -81,11 +81,9 @@
*/
resizePixel : function (col, row, size) {
var pixels = [];
var i;
var j;
for (j = 0; j < size; j++) {
for (i = 0; i < size; i++) {
for (var j = 0; j < size; j++) {
for (var i = 0; i < size; i++) {
pixels.push([col - Math.floor(size / 2) + i, row - Math.floor(size / 2) + j]);
}
}

View file

@ -5,7 +5,7 @@
<div class="pen-size-option" data-size="1"></div>
<div class="pen-size-option" data-size="2"></div>
<div class="pen-size-option" data-size="3"></div>
<div class="pen-size-option" data-size="4" real-pen-size="6"></div>
<div class="pen-size-option" data-size="4"></div>
</div>
<ul id="tools-container" class="tools-wrapper">
<!-- Drawing tools will be inserted here -->

View file

@ -51,11 +51,11 @@ describe("PenSize test suite", function() {
});
it("skips invalid value (outside of [1, 4])", function() {
console.log('[PenSizeService] skips invalid value (outside of [1, 4])');
console.log('[PenSizeService] skips invalid value (outside of [1, 32])');
userSettingsPenSize = 1;
penSizeService.init();
// MAX_VALUE is 4
// MAX_VALUE is 32
penSizeService.setPenSize(33);
expect(penSizeService.getPenSize()).toBe(1);
// MIN_VALUE is 1