From fd9743a3592ec296d8e864bedac032cfa1094727 Mon Sep 17 00:00:00 2001 From: Alejandro Cavazos Date: Mon, 5 Mar 2018 17:27:16 -0600 Subject: [PATCH 1/2] Trim floating point values before requestin cloudimg image --- src/widget/widget.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/widget/widget.js b/src/widget/widget.js index 85fd064..8dffbdd 100644 --- a/src/widget/widget.js +++ b/src/widget/widget.js @@ -73,9 +73,11 @@ function render() { // Set background image if needed if (design && design.backgroundImage) { const DPR = window.devicePixelRatio; + const width = Math.ceil(state.width * DPR); + const height = Math.ceil(state.height * DPR); const baseUrl = 'https://czi3m2qn.cloudimg.io/s/crop'; - const cropUrl = `${baseUrl}/${state.width * DPR}x${state.height * DPR}`; + const cropUrl = `${baseUrl}/${width}x${height}`; const url = `${cropUrl}/${design.backgroundImage}`; window.document.body.setAttribute('style', ` From 5f374e67c1c6dddd1be51a0070659811d48dd33a Mon Sep 17 00:00:00 2001 From: Alejandro Cavazos Date: Mon, 12 Mar 2018 12:15:43 -0600 Subject: [PATCH 2/2] Add appearance ready api --- src/widget/widget.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/widget/widget.js b/src/widget/widget.js index 8dffbdd..83e6d2b 100644 --- a/src/widget/widget.js +++ b/src/widget/widget.js @@ -92,6 +92,12 @@ function render() { // Render HTML content textContainer.innerHTML = content.text; + + try { + buildfire.appearance.ready(); + } catch (err) { + console.log('appearance.ready() failed, is sdk up to date?'); + } }