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, h, w)
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

push!(win, can)


@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, h, w)
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


push!(win, can)
show(can)
show(can)
condition = Condition()
condition = Condition()