1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-26 01:35:28 +03:00

Merge pull request #270 from stronnag/green-prop-circles

update motor diagrams to new colour theme
This commit is contained in:
Dominic Clifton 2015-11-11 20:38:56 +00:00
commit a52e8816e4

View file

@ -45,6 +45,11 @@ class Model
SW=2 SW=2
NW=3 NW=3
# Colours
BODY_GREY='#bababa'
CIRCLE_GREEN = '#54ad1d'
ARROW_RED = '#fa0700'
# We use StringIO in order to be able to add a (non-)copyright statement # We use StringIO in order to be able to add a (non-)copyright statement
def initialize filename def initialize filename
@lw = RADIUS @lw = RADIUS
@ -56,7 +61,7 @@ class Model
end end
# Draw an arbitrary path, x,y pairs terminated by ! # Draw an arbitrary path, x,y pairs terminated by !
def draw_path path,fill=:silver,round=false def draw_path path,fill=BODY_GREY,round=false
@cr.set_line_cap(Cairo::LINE_JOIN_ROUND) if round @cr.set_line_cap(Cairo::LINE_JOIN_ROUND) if round
@cr.set_source_color(fill) @cr.set_source_color(fill)
@cr.set_line_width(@lw) @cr.set_line_width(@lw)
@ -78,7 +83,7 @@ class Model
# Draw body parts, really just a rounded line # Draw body parts, really just a rounded line
def draw_body x1,y1,x2,y2 def draw_body x1,y1,x2,y2
@cr.set_source_color(:silver) @cr.set_source_color(BODY_GREY)
@cr.set_line_width(@lw) @cr.set_line_width(@lw)
@cr.set_line_join(Cairo::LINE_JOIN_ROUND) @cr.set_line_join(Cairo::LINE_JOIN_ROUND)
@cr.move_to(x1,y1) @cr.move_to(x1,y1)
@ -100,7 +105,7 @@ class Model
# Draw direction arrow at Y offset # Draw direction arrow at Y offset
def draw_dirn y=80 def draw_dirn y=80
@cr.set_line_join(Cairo::LINE_JOIN_BEVEL) @cr.set_line_join(Cairo::LINE_JOIN_BEVEL)
@cr.set_source_color(:red) @cr.set_source_color(ARROW_RED)
@cr.move_to(100,y) @cr.move_to(100,y)
@cr.set_line_width(12) @cr.set_line_width(12)
@cr.rel_line_to(0, 40) @cr.rel_line_to(0, 40)
@ -117,7 +122,7 @@ class Model
# Draw a circle, perhaps with directional arrows # Draw a circle, perhaps with directional arrows
# lyoffset, lxoffset change label position # lyoffset, lxoffset change label position
def draw_circle x,y,label,dirn=CCW,loc=NE,fill=nil,colour=nil,lyoffset=0,lxoffset=0 def draw_circle x,y,label,dirn=CCW,loc=NE,fill=nil,colour=nil,lyoffset=0,lxoffset=0
col = (colour||Cairo::Color::ROYAL_BLUE) col = (colour||CIRCLE_GREEN)
@cr.set_font_size(@radius) @cr.set_font_size(@radius)
@cr.set_line_join(Cairo::LINE_JOIN_MITER) @cr.set_line_join(Cairo::LINE_JOIN_MITER)
@cr.set_line_width(3) @cr.set_line_width(3)