diff --git a/addons/hunspell/bin/hunspell.windows.template_debug.x86_64.dll b/addons/hunspell/bin/hunspell.windows.template_debug.x86_64.dll new file mode 100644 index 0000000..f38524c Binary files /dev/null and b/addons/hunspell/bin/hunspell.windows.template_debug.x86_64.dll differ diff --git a/addons/hunspell/bin/hunspell.windows.template_release.x86_64.dll b/addons/hunspell/bin/hunspell.windows.template_release.x86_64.dll new file mode 100644 index 0000000..78a8783 Binary files /dev/null and b/addons/hunspell/bin/hunspell.windows.template_release.x86_64.dll differ diff --git a/addons/hunspell/bin/libhunspell.linux.template_debug.x86_64.so b/addons/hunspell/bin/libhunspell.linux.template_debug.x86_64.so new file mode 100644 index 0000000..6ff4c8e Binary files /dev/null and b/addons/hunspell/bin/libhunspell.linux.template_debug.x86_64.so differ diff --git a/addons/hunspell/bin/libhunspell.linux.template_release.x86_64.so b/addons/hunspell/bin/libhunspell.linux.template_release.x86_64.so new file mode 100644 index 0000000..e964826 Binary files /dev/null and b/addons/hunspell/bin/libhunspell.linux.template_release.x86_64.so differ diff --git a/addons/hunspell/bin/libhunspell.macos.template_debug.universal.dylib b/addons/hunspell/bin/libhunspell.macos.template_debug.universal.dylib new file mode 100755 index 0000000..b5f2fc7 Binary files /dev/null and b/addons/hunspell/bin/libhunspell.macos.template_debug.universal.dylib differ diff --git a/addons/hunspell/bin/libhunspell.macos.template_release.universal.dylib b/addons/hunspell/bin/libhunspell.macos.template_release.universal.dylib new file mode 100755 index 0000000..fd81add Binary files /dev/null and b/addons/hunspell/bin/libhunspell.macos.template_release.universal.dylib differ diff --git a/addons/hunspell/hunspell.gdextension b/addons/hunspell/hunspell.gdextension new file mode 100644 index 0000000..a3209f5 --- /dev/null +++ b/addons/hunspell/hunspell.gdextension @@ -0,0 +1,22 @@ +[configuration] + +entry_symbol = "hunspell_library_init" +compatibility_minimum = "4.2" + +[libraries] + +windows.debug.x86_64 = "res://addons/hunspell/bin/hunspell.windows.template_debug.x86_64.dll" +windows.release.x86_64 = "res://addons/hunspell/bin/hunspell.windows.template_release.x86_64.dll" +linux.debug.x86_64 = "res://addons/hunspell/bin/libhunspell.linux.template_debug.x86_64.so" +linux.release.x86_64 = "res://addons/hunspell/bin/libhunspell.linux.template_release.x86_64.so" +macos.debug = "res://addons/hunspell/bin/libhunspell.macos.template_debug.universal.dylib" +macos.release = "res://addons/hunspell/bin/libhunspell.macos.template_release.universal.dylib" + +[dependencies] + +windows.debug.x86_64 = {} +windows.release.x86_64 = {} +linux.debug.x86_64 = {} +linux.release.x86_64 = {} +macos.debug = {} +macos.release = {} diff --git a/ui/spell_underline.gd b/ui/spell_underline.gd index 00a390d..83cd181 100644 --- a/ui/spell_underline.gd +++ b/ui/spell_underline.gd @@ -35,6 +35,8 @@ static func attach(field: Control, p_main: Main) -> void: func _ready() -> void: set_anchors_and_offsets_preset(PRESET_FULL_RECT) mouse_filter = MOUSE_FILTER_IGNORE + # Text scrolled out of a narrow field must not be underlined outside it. + clip_contents = true add_to_group(GROUP) if field is LineEdit: (field as LineEdit).text_changed.connect(func(_s: String) -> void: recheck()) @@ -84,7 +86,12 @@ func _wave(x0: float, x1: float, y: float) -> void: func _segments(r: Vector2i) -> Array: if field is LineEdit: var y := size.y - _line_margin_bottom() - return [[_line_x(r.x), _line_x(r.y), y]] + var sb := field.get_theme_stylebox("normal") + var left := sb.get_margin(SIDE_LEFT) if sb else 0.0 + var right := size.x - (sb.get_margin(SIDE_RIGHT) if sb else 0.0) + var x0 := maxf(left, _line_x(r.x)) + var x1 := minf(right, _line_x(r.y)) + return [[x0, x1, y]] if x1 > x0 else [] var edit := field as TextEdit var out: Array = [] for i in range(r.x, r.y):