forked from HEL/chronos
		
	implemented create event + create offset
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							| @@ -136,3 +136,10 @@ | |||||||
|   _seq("[", "a", comment: [Test]) |   _seq("[", "a", comment: [Test]) | ||||||
|   _note("left", [This is also a note]) |   _note("left", [This is also a note]) | ||||||
| })*/ | })*/ | ||||||
|  |  | ||||||
|  | #pagebreak() | ||||||
|  |  | ||||||
|  | #chronos.diagram({ | ||||||
|  |   _seq("Bob", "Alice", comment: [Hello]) | ||||||
|  |   _evt("Other", "create") | ||||||
|  | }) | ||||||
| @@ -123,6 +123,16 @@ | |||||||
|         elmt: elmt, |         elmt: elmt, | ||||||
|         i: i |         i: i | ||||||
|       ) |       ) | ||||||
|  |     } else if elmt.type == "evt" { | ||||||
|  |       let par = elmt.participant | ||||||
|  |       if not participant._exists(participants, par) { | ||||||
|  |         let p = _par(par, from-start: elmt.event != "create").first() | ||||||
|  |         participants.push(p) | ||||||
|  |        | ||||||
|  |       } else if elmt.event == "create" { | ||||||
|  |         let i = participants.position(p => p.name == par) | ||||||
|  |         participants.at(i).from-start = false | ||||||
|  |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   linked = linked.dedup() |   linked = linked.dedup() | ||||||
|   | |||||||
| @@ -279,6 +279,7 @@ | |||||||
|         line.lines.push(("enable", y, elmt.lifeline-style)) |         line.lines.push(("enable", y, elmt.lifeline-style)) | ||||||
|        |        | ||||||
|       } else if elmt.event == "create" { |       } else if elmt.event == "create" { | ||||||
|  |         y -= CREATE-OFFSET | ||||||
|         shapes += participant.render(x-pos, par, y: y) |         shapes += participant.render(x-pos, par, y: y) | ||||||
|         line.lines.push(("create", y)) |         line.lines.push(("create", y)) | ||||||
|       } |       } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user