fullstack-lang/gongsvg

Persistance issue with AnchoredText

Closed this issue · 5 comments

Sequence:

  • move "end anchored text 1" to have offset X large
  • on the front data explorer, the X offset is at -185
  • "end anchored text 2" is reset at 0,0
  • restart the server

Unexpected result:

  • many offset values has been reset during the load

analysis: this is a problem on the front.
when loaded,

this.Link.TextAtArrowStart[0].Y_Offset is 0 instead of not zero.

Let's see if it is a problem during the frontRepo pull. Let's go down to only one anchored text

http://localhost:8080/api/github.com/fullstack-lang/gongsvg/go/v1/anchoredtexts?GONG__StackPath=github.com/fullstack-lang/gongsvg/go/models

[{"ID":1,"CreatedAt":"0001-01-01T00:00:00Z","UpdatedAt":"0001-01-01T00:00:00Z","DeletedAt":null,"Name":"Start Anchored 1","Content":"Start Anchored 1","X_Offset":203,

"Y_Offset":0,

"Color":"","FillOpacity":0,"Stroke":"cyan","StrokeWidth":2,"StrokeDashArray":"","StrokeDashArrayWhenSelected":"","Transform":"","Animates":null,"Link_TextAtArrowEndDBID":{"Int64":0,"Valid":false},"Link_TextAtArrowEndDBID_Index":{"Int64":0,"Valid":false},"Link_TextAtArrowStartDBID":{"Int64":1,"Valid":true},"Link_TextAtArrowStartDBID_Index":{"Int64":0,"Valid":true}}]

A problem from the back !

Maybe in the name of the field "_" ??

This is a problem with the back.

anchoredtextDBs[0].Y_Offset_Data.Float64 is 0

Is it the unmarshalling ?

found the problem in gong_ast

				switch fieldName {
				case "Y_Offset":
					// convert string to float64
					fielValue, err := strconv.ParseFloat(basicLit.Value, 64)
					if err != nil {
						log.Fatalln(err)
					}

					__gong__map_AnchoredText[identifier].Y_Offset = fielValue

is not performed

Vu ! It's because this is a negative value and gong_ast does not process them (instead basic Lit)