Skip to content
Snippets Groups Projects
Commit 00eaceff authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

fixed regression in the search plugin due to use of negative (universal) font sizes.

parent d4f64aaf
No related branches found
No related tags found
No related merge requests found
...@@ -1352,26 +1352,26 @@ proc ::dialog_search::ctrl_bksp {mytoplevel} { ...@@ -1352,26 +1352,26 @@ proc ::dialog_search::ctrl_bksp {mytoplevel} {
proc ::dialog_search::font_size {text direction} { proc ::dialog_search::font_size {text direction} {
variable searchfont variable searchfont
set offset {} set offset {}
set min_fontsize 8 set min_fontsize -8
if {$direction == 1} { if {$direction == 1} {
set offset 2
} else {
set offset -2 set offset -2
} else {
set offset 2
} }
set update 1 set update 1
foreach tag [$text tag names] { foreach tag [$text tag names] {
set val [$text tag cget $tag -font] set val [$text tag cget $tag -font]
if {[string is digit -strict [lindex $val 1]] && if {[string is digit -strict [lindex $val 1]] &&
[expr {[lindex $val 1]+$offset}] < $min_fontsize} { [expr {[lindex $val 1]+$offset}] > $min_fontsize} {
set update 0 set update 0
} }
} }
if {$update} { if {$update} {
foreach tag [$text tag names] { foreach tag [$text tag names] {
set val [$text tag cget $tag -font] set val [$text tag cget $tag -font]
if {[string is digit -strict [lindex $val 1]]} { if {[string is ascii -strict [lindex $val 1]]} {
$text tag configure $tag -font "$searchfont \ $text tag configure $tag -font "$searchfont \
[expr -{max([lindex $val 1]+$offset,$min_fontsize)}]" [expr {min([lindex $val 1]+$offset,$min_fontsize)}]"
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment