Closed nullstalgia closed 4 years ago
Thanks for doing this! Looks good. I pushed fixes for the two things you mentioned in (2)
re: (3) -- all other types of regions render the appropriate shape without creating a Region instance. For example, with texts, it's just calling display->print
directly:
if (text.containsKey("value")) {
text = text["value"];
if (text["type"] == "static") {
display->print(text["value"].as<const char*>());
}
// fall back on v1 format where "static" and "variable" are inline with
// the definition
} else {
if (text.containsKey("static")) {
display->print(text["static"].as<const char*>());
}
}
we could do the same with rectangle, but it's a slightly harder to detect whether the region is static or variable because both width and height can be variable.
calling region->render()
in place is probably fine. the overhead is gonna be pretty minimal.
re: (4), probably best to just make sure regions that should support background colors have it. Would rather not add it to the base schema as it doesn't make sense for everything (mainly things that only have a stroke, like lines).
@nullstalgia, I think this is ready to go if you're comfortable.
I haven't tested it yet, sorry!
I've been out of state for a few days, should be back by the weekend.
No rush at all. Safe travels.
Seems good. Merge when ready, @sidoh
Question though, do you have a way to test webpage changes without uploading them to the ESP? If so, can you write out a guide and post it either here or in a .md
for us contributors? :)
Sweet. Thanks!
Yeah, you can run:
npm run start
from ./web
. The dev server will proxy API requests to a host named epaper-display
. You can edit the remote host by changing the constant API_SERVER_ADDRESS
in .neutrinorc.js
.
Happy to add this to a README, will do that sometime soon (thanks for the suggestion)
And you thought you were rid of me.
Hasn't even been 24 hours.
Four main things:
Vs
I need help getting two things working
filled
in the template editor(Static?) Rectangles were not being rendered on boot without some change happening to them first. Adding
region->render()
to it being added to the region list solved that.region->render()
, and let the stack reclaim the memory? That way, we only have to change the render functions in one spot (and it looks nicer).everything needs a fscking background color. I considered adding it to the Region parent class, but didn't have any luck... Would it be better to instead add it to the json object when passing it to the renderX functions?