Skip to content

Commit

Permalink
use GetSampleShape in raster -- otherwise crashes. update to latest c…
Browse files Browse the repository at this point in the history
…ore 0.3.5 with key back arrow and netview path selection fixes.
  • Loading branch information
rcoreilly committed Oct 19, 2024
1 parent 58c83eb commit fe19c11
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/emer/emergent/v2
go 1.22

require (
cogentcore.org/core v0.3.4
cogentcore.org/core v0.3.5
github.com/BurntSushi/toml v1.3.2
github.com/stretchr/testify v1.9.0
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cogentcore.org/core v0.3.4 h1:cR+tbFHobLYwAdIW7+0WXnnUdinidrnBse6iqnIBuL0=
cogentcore.org/core v0.3.4/go.mod h1:HiWp9KXOQmYNaW5wdGpMBEHQTVprdsfBzVmTJ8OPk1A=
cogentcore.org/core v0.3.5 h1:qTW/+GSUbeYYCSi29zdAQ/fnjWg2/E/aTbAMbfAFGfI=
cogentcore.org/core v0.3.5/go.mod h1:q3OrXihYG2aTE2oG785ad5b6aJ3wzSCXeeD2SSLKWIE=
github.com/Bios-Marcel/wastebasket v0.0.4-0.20240213135800-f26f1ae0a7c4 h1:6lx9xzJAhdjq0LvVfbITeC3IH9Fzvo1aBahyPu2FuG8=
github.com/Bios-Marcel/wastebasket v0.0.4-0.20240213135800-f26f1ae0a7c4/go.mod h1:FChzXi1izqzdPb6BiNZmcZLGyTYiT61iGx9Rxx9GNeI=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
Expand Down
12 changes: 6 additions & 6 deletions netview/layraster.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

func (lm *LayMesh) RasterSize2D() (nVtx, nIndex int) {
ss := &lm.Lay.AsEmer().SampleShape
ss := lm.Lay.AsEmer().GetSampleShape()
nuz := ss.DimSize(0)
nux := ss.DimSize(1)
nz := nuz*nux + nuz - 1
Expand All @@ -24,7 +24,7 @@ func (lm *LayMesh) RasterSize2D() (nVtx, nIndex int) {
}

func (lm *LayMesh) RasterSize4D() (nVtx, nIndex int) {
ss := &lm.Lay.AsEmer().SampleShape
ss := lm.Lay.AsEmer().GetSampleShape()
npz := ss.DimSize(0) // p = pool
npx := ss.DimSize(1)
nuz := ss.DimSize(2) // u = unit
Expand All @@ -42,7 +42,7 @@ func (lm *LayMesh) RasterSize4D() (nVtx, nIndex int) {
}

func (lm *LayMesh) RasterSet2DX(vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) {
ss := &lm.Lay.AsEmer().SampleShape
ss := lm.Lay.AsEmer().GetSampleShape()
nuz := ss.DimSize(0)
nux := ss.DimSize(1)
nz := nuz*nux + nuz - 1
Expand Down Expand Up @@ -123,7 +123,7 @@ func (lm *LayMesh) RasterSet2DX(vtxAry, normAry, texAry, clrAry math32.ArrayF32,
}

func (lm *LayMesh) RasterSet2DZ(vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) {
ss := &lm.Lay.AsEmer().SampleShape
ss := lm.Lay.AsEmer().GetSampleShape()
nuz := ss.DimSize(0)
nux := ss.DimSize(1)
nx := nuz*nux + nuz - 1
Expand Down Expand Up @@ -203,7 +203,7 @@ func (lm *LayMesh) RasterSet2DZ(vtxAry, normAry, texAry, clrAry math32.ArrayF32,
}

func (lm *LayMesh) RasterSet4DX(vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) {
ss := &lm.Lay.AsEmer().SampleShape
ss := lm.Lay.AsEmer().GetSampleShape()
npz := ss.DimSize(0) // p = pool
npx := ss.DimSize(1)
nuz := ss.DimSize(2) // u = unit
Expand Down Expand Up @@ -304,7 +304,7 @@ func (lm *LayMesh) RasterSet4DX(vtxAry, normAry, texAry, clrAry math32.ArrayF32,
}

func (lm *LayMesh) RasterSet4DZ(vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) {
ss := &lm.Lay.AsEmer().SampleShape
ss := lm.Lay.AsEmer().GetSampleShape()
npz := ss.DimSize(0) // p = pool
npx := ss.DimSize(1)
nuz := ss.DimSize(2) // u = unit
Expand Down
2 changes: 1 addition & 1 deletion netview/netview.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ func (nv *NetView) UnitValue(lay emer.Layer, idx []int) (raw, scaled float32, cl
// scaled is in range -1..1
func (nv *NetView) UnitValRaster(lay emer.Layer, idx []int, rCtr int) (raw, scaled float32, clr color.RGBA, hasval bool) {
lb := lay.AsEmer()
idx1d := lb.SampleShape.Offset(idx)
idx1d := lb.GetSampleShape().Offset(idx)
ridx := lb.SampleIndexes
if len(ridx) == 0 { // no rep
if idx1d >= lb.Shape.Len() {
Expand Down

0 comments on commit fe19c11

Please sign in to comment.