Honeycombs: Difference between revisions
Content added Content deleted
Line 1,433: | Line 1,433: | ||
hexagon(ctx, h::Hexagon) = hexagon(ctx, h.center, h.radius, h.letter, h.color) |
hexagon(ctx, h::Hexagon) = hexagon(ctx, h.center, h.radius, h.letter, h.color) |
||
function makehoneycomb(ctx |
function makehoneycomb(ctx) |
||
centers = fill(Point(0, 0), hcombdim.rows, hcombdim.cols) |
centers = fill(Point(0, 0), hcombdim.rows, hcombdim.cols) |
||
xdelta = 75.0 |
xdelta = 75.0 |
||
Line 1,444: | Line 1,444: | ||
centers |
centers |
||
end |
end |
||
⚫ | |||
@guarded draw(can) do widget |
@guarded draw(can) do widget |
||
ctx = getgc(can) |
ctx = getgc(can) |
||
h = height(can) |
|||
w = width(can) |
|||
if length(honeycomb) == 0 |
if length(honeycomb) == 0 |
||
makehoneycomb(ctx |
makehoneycomb(ctx) |
||
else |
else |
||
map(c -> hexagon(ctx, honeycomb[c]), collect(keys(honeycomb))) |
map(c -> hexagon(ctx, honeycomb[c]), collect(keys(honeycomb))) |
||
Line 1,482: | Line 1,478: | ||
end |
end |
||
⚫ | |||
show(can) |
show(can) |
||
condition = Condition() |
condition = Condition() |