Make sure colorpicker is always drawn

This commit is contained in:
Paulus Schoutsen 2016-02-10 22:15:17 -08:00
parent cac1953eb6
commit 77a2f3ace3
2 changed files with 9 additions and 9 deletions

View File

@ -98,12 +98,12 @@ export default new Polymer({
this.context = this.canvas.getContext('2d');
this.debounce('drawGradient', () => {
const style = getComputedStyle(this);
const width = parseInt(style.width, 10);
const height = parseInt(style.height, 10);
this.width = width;
this.height = height;
let style;
if (!this.width || !this.height) {
style = getComputedStyle(this);
}
const width = this.width || parseInt(style.width, 10);
const height = this.height || parseInt(style.height, 10);
const colorGradient = this.context.createLinearGradient(0, 0, width, 0);
colorGradient.addColorStop(0, 'rgb(255,0,0)');

View File

@ -21,7 +21,7 @@
max-height: 0px;
overflow: hidden;
transition: max-height .5s ease-in;
transition: max-height .2s ease-in;
}
.has-brightness .brightness {
@ -33,7 +33,7 @@
}
.has-rgb_color ha-color-picker {
max-height: 500px;
max-height: 200px;
}
</style>
<template>
@ -53,7 +53,7 @@
</paper-slider>
</div>
<ha-color-picker on-colorselected='colorPicked'>
<ha-color-picker on-colorselected='colorPicked' height='200'>
</ha-color-picker>
</div>
</template>