@papercraftgames/estragon 0.1.0-beta.13 → 0.1.0-beta.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -519,6 +519,7 @@ func candidates(text: String, source: String, lexical: RefCounted, row: int, col
519
519
  if context.mode=="gd" and member_cursor>=0 and left[member_cursor]=="." and item.kind==CodeEdit.KIND_FUNCTION and not callable_attribute and not lexical.lines[row].substr(column).strip_edges().begins_with("("):
520
520
  insert += "()"
521
521
  var display: String = str(name) if item.has("import") else (str(name)+" — "+str(item.origin) if item.has("origin") else str(name))
522
+ if context.mode == "tag" and item.kind == CodeEdit.KIND_MEMBER and not str(item.get("type","")).is_empty(): display += " — "+str(item.type)
522
523
  if context.mode == "tag" and not item.has("import") and ClassDB.class_exists(insert): display += " — Godot "+ClassDB.get_parent_class(insert)
523
524
  result.append({"text":display,"insert":insert,"kind":item.kind,"row":row,"start":cursor if context.mode == "tag" and context.closing else cursor+1,"column":column,"hint":item.get("hint",""),"imports":[item["import"]] if item.has("import") else []})
524
525
  result.sort_custom(func(a,b): return a.text < b.text)
@@ -3,5 +3,5 @@
3
3
  name="Estragon"
4
4
  description="Native Gogo/GGX highlighting, compilation and validation before Play."
5
5
  author="Resist Design"
6
- version="0.1.0-beta.13"
6
+ version="0.1.0-beta.14"
7
7
  script="plugin.gd"
@@ -66,8 +66,8 @@ func _layout_options() -> Dictionary:
66
66
  func _is_layout_entry() -> bool:
67
67
  return false
68
68
 
69
- func _layout_viewport_scale() -> float:
70
- return 0.0
69
+ func _layout_viewport_scale() -> Vector2:
70
+ return Vector2.ZERO
71
71
 
72
72
  func _changed() -> void:
73
73
  if layout != null: layout.changed()
@@ -52,8 +52,8 @@ func requested_extent() -> Vector3:
52
52
  func _is_layout_entry() -> bool:
53
53
  return false
54
54
 
55
- func _layout_viewport_scale() -> float:
56
- return 0.0
55
+ func _layout_viewport_scale() -> Vector2:
56
+ return Vector2.ZERO
57
57
 
58
58
  func _changed() -> void:
59
59
  if layout != null: layout.changed()
@@ -8,11 +8,17 @@ extends "component_2d.gd"
8
8
  viewport_width_scale = value
9
9
  if layout != null: layout._invalidated()
10
10
 
11
+ @export var viewport_height_scale: float = 0.0:
12
+ set(value):
13
+ if not is_finite(value) or value < 0 or viewport_height_scale == value: return
14
+ viewport_height_scale = value
15
+ if layout != null: layout._invalidated()
16
+
11
17
  func _is_layout_entry() -> bool:
12
18
  return true
13
19
 
14
- func _layout_viewport_scale() -> float:
15
- return viewport_width_scale
20
+ func _layout_viewport_scale() -> Vector2:
21
+ return Vector2(viewport_width_scale,viewport_height_scale)
16
22
 
17
23
  const Pointer = preload("internal/pointer_2d.gd")
18
24
  var _pointer = Pointer.new(self)
@@ -8,8 +8,14 @@ extends "component_3d.gd"
8
8
  viewport_width_scale = value
9
9
  if layout != null: layout._invalidated()
10
10
 
11
+ @export var viewport_height_scale: float = 0.0:
12
+ set(value):
13
+ if not is_finite(value) or value < 0 or viewport_height_scale == value: return
14
+ viewport_height_scale = value
15
+ if layout != null: layout._invalidated()
16
+
11
17
  func _is_layout_entry() -> bool:
12
18
  return true
13
19
 
14
- func _layout_viewport_scale() -> float:
15
- return viewport_width_scale
20
+ func _layout_viewport_scale() -> Vector2:
21
+ return Vector2(viewport_width_scale,viewport_height_scale)
@@ -62,8 +62,8 @@ func root_host() -> Node:
62
62
  var found = scope_root()
63
63
  return found._host.get_ref() if found != null else null
64
64
 
65
- func _viewport_scale(host: Node) -> float:
66
- return host.viewport_width_scale if _mode == Mode.PROOF else host._layout_viewport_scale()
65
+ func _viewport_scale(host: Node) -> Vector2:
66
+ return Vector2(host.viewport_width_scale,0) if _mode == Mode.PROOF else host._layout_viewport_scale()
67
67
 
68
68
  func start() -> void:
69
69
  active = true
@@ -139,7 +139,9 @@ func changed() -> void:
139
139
 
140
140
  func _viewport_changed() -> void:
141
141
  var host = _host.get_ref()
142
- if host != null and parent_coordinator() == null and _viewport_scale(host) > 0: _invalidated()
142
+ if host == null or parent_coordinator() != null: return
143
+ var scale := _viewport_scale(host)
144
+ if scale.x > 0 or scale.y > 0: _invalidated()
143
145
 
144
146
  func _invalidated() -> void:
145
147
  if Profile.is_enabled(): Profile.add("layout_invalidations")
@@ -155,8 +157,11 @@ func _flush() -> void:
155
157
  flush_count += 1
156
158
  if Profile.is_enabled(): Profile.add("layout_flushes")
157
159
  var available: Vector3 = model.measure()
158
- if _viewport_scale(host) > 0 and _viewport != null:
159
- available.x = _viewport.get_visible_rect().size.x * _viewport_scale(host)
160
+ if _viewport != null:
161
+ var scale := _viewport_scale(host)
162
+ var visible := _viewport.get_visible_rect().size
163
+ if scale.x > 0: available.x = visible.x * scale.x
164
+ if scale.y > 0: available.y = visible.y * scale.y
160
165
  model.arrange(available)
161
166
  CompositionHosts.refresh_positions(self)
162
167
 
package/package.json CHANGED
@@ -29,5 +29,5 @@
29
29
  "tag": "beta",
30
30
  "registry": "https://registry.npmjs.org/"
31
31
  },
32
- "version": "0.1.0-beta.13"
32
+ "version": "0.1.0-beta.14"
33
33
  }