Skip to content

Commit fff6bd7

Browse files
author
chmerdon
committed
make sure resolution is Int
1 parent fe5c797 commit fff6bd7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

ext/GridVisualizeUnicodePlotsExt.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function gridplot!(ctx, TP::Type{UnicodePlotsType}, ::Type{Val{2}}, grid)
6565
end
6666

6767
# determine resolution
68-
resolution = ctx[:size]
68+
resolution = @. Int(round(ctx[:size]))
6969
legend_space = 4
7070
aspect = ctx[:aspect] * resolution[1] / (resolution[1] + legend_space)
7171

@@ -213,7 +213,7 @@ function gridplot!(ctx, TP::Type{UnicodePlotsType}, ::Type{Val{1}}, grid)
213213
end
214214

215215
# determine resolution
216-
resolution = (ctx[:size][1], 5)
216+
resolution = (Int(round(ctx[:size][1])), 5)
217217

218218
# create UnicodePlots.Canvas
219219
legend_space = 5
@@ -303,7 +303,7 @@ function scalarplot!(
303303
)
304304

305305
nfuncs = length(funcs)
306-
resolution = ctx[:size]
306+
resolution = @. Int(round(ctx[:size]))
307307
ylim = ctx[:limits]
308308

309309
if ylim[1] > ylim[2]
@@ -338,7 +338,7 @@ function scalarplot!(
338338
)
339339

340340
func = funcs[1]
341-
resolution = ctx[:size]
341+
resolution = resolution = @. Int(round(ctx[:size]))
342342
ylim = ctx[:limits]
343343
colormap = ctx[:colormap]
344344

0 commit comments

Comments
 (0)