Skip to content

Commit 4af3102

Browse files
author
Brad Carman
committed
update Makie
1 parent add97eb commit 4af3102

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

Project.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ModelingToolkitDesigner"
22
uuid = "23d639d0-9462-4d1e-84fe-d700424865b8"
33
authors = ["Brad Carman <[email protected]>"]
4-
version = "1.1.1"
4+
version = "1.2.0"
55

66
[deps]
77
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
@@ -13,11 +13,11 @@ ModelingToolkitStandardLibrary = "16a59e39-deab-5bd0-87e4-056b12336739"
1313
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
1414

1515
[compat]
16-
CairoMakie = "0.10"
16+
CairoMakie = "0.11"
1717
FileIO = "1.16"
1818
FilterHelpers = "0.2"
19-
GLMakie = "0.8"
20-
ModelingToolkit = "8.50"
19+
GLMakie = "0.9"
20+
ModelingToolkit = "8"
2121
ModelingToolkitStandardLibrary = "2"
2222
TOML = "1.0"
2323
julia = "1.6"

src/ModelingToolkitDesigner.jl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -520,18 +520,17 @@ function view(design::ODESystemDesign, interactive = true)
520520
yobservable = image[2]
521521
yvalues = yobservable[]
522522

523-
524-
x = xvalues[1] + Δh * 0.8
525-
y = yvalues[1] + Δh * 0.8
523+
x = xvalues.left + Δh * 0.8
524+
y = yvalues.left + Δh * 0.8
526525
selected_system = filtersingle(
527526
s -> is_tuple_approx(s.xy[], (x, y); atol = 1e-3),
528527
[design.components; design.connectors],
529528
)
530529

531530
if isnothing(selected_system)
532531

533-
x = xvalues[1] + Δh * 0.8 * 0.5
534-
y = yvalues[1] + Δh * 0.8 * 0.5
532+
x = xvalues.left + Δh * 0.8 * 0.5
533+
y = yvalues.left + Δh * 0.8 * 0.5
535534
selected_system = filterfirst(
536535
s -> is_tuple_approx(s.xy[], (x, y); atol = 1e-3),
537536
[design.components; design.connectors],
@@ -1045,8 +1044,8 @@ end
10451044

10461045
function draw_icon!(ax::Axis, design::ODESystemDesign)
10471046

1048-
xo = Observable(zeros(2))
1049-
yo = Observable(zeros(2))
1047+
xo = Observable((0.0,0.0))
1048+
yo = Observable((0.0,0.0))
10501049

10511050

10521051
scale = if ModelingToolkit.isconnector(design.system)
@@ -1060,8 +1059,8 @@ function draw_icon!(ax::Axis, design::ODESystemDesign)
10601059
x = val[1]
10611060
y = val[2]
10621061

1063-
xo[] = [x - Δh * scale, x + Δh * scale]
1064-
yo[] = [y - Δh * scale, y + Δh * scale]
1062+
xo[] = (x - Δh * scale, x + Δh * scale)
1063+
yo[] = (y - Δh * scale, y + Δh * scale)
10651064

10661065
end
10671066

0 commit comments

Comments
 (0)