-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial port of concentricity project #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, just some optional alternatives.
var round = require('./round'); | ||
var rect = require('./rect'); | ||
|
||
function DrawCommand(platform) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you could just require the relevant file based on platform.
if(rocky.watchInfo.platform === 'chalk') { //require round } else { //require rect }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The require is a directive to webpack to include a module in the bundled JS file. At bundling time, rocky.watchInfo.platform
doesn't exist (it's an API accessible at runtime) and I'm not sure how webpack would handle this (maybe ignore it?)
this.minutes = round.drawMinutes; | ||
this.seconds = round.drawSeconds; | ||
} | ||
if (['basalt', 'chalk', 'emery'].indexOf(platform) >= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again here, it would be simpler to:
if (platform === 'diorite') { //bw } else { //color }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish we had a color/bw attribute on watchinfo =(
// Set the drawing color | ||
ctx.fillStyle = color; | ||
|
||
if (endAngle == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (endAngle === 0) {
One minor comment, other than that LGTM! 👍 |
An initial attempt to port the existing concentricity watchface over to Rocky.js