File tree 2 files changed +18
-1
lines changed
orangecontrib/text/widgets
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,23 @@ def on_cloud_pref_change(self):
169
169
self .webview .evalJS ('OPTIONS["minRotation"] = {}; \
170
170
OPTIONS["maxRotation"] = {};' .format (- tilt_amount , tilt_amount ))
171
171
self .webview .evalJS ('OPTIONS["rotateRatio"] = {};' .format (tilt_ratio ))
172
+ self .webview .evalJS ('''
173
+ OPTIONS["gridSize"] = function () {
174
+ return Math.round(
175
+ Math.min(
176
+ document.getElementById("canvas").clientWidth,
177
+ document.getElementById("canvas").clientHeight
178
+ ) / 48
179
+ );
180
+ };''' )
181
+ self .webview .evalJS ('''
182
+ OPTIONS["weightFactor"] = function (size) {
183
+ return size *
184
+ Math.min(
185
+ document.getElementById("canvas").clientWidth,
186
+ document.getElementById("canvas").clientHeight
187
+ ) / 512;
188
+ };''' )
172
189
# Trigger cloud redrawing by constructing new webview, because everything else fail Macintosh
173
190
self .webview .evalJS ('OPTIONS["list"] = {};' .format (self .wordlist ))
174
191
self .webview .evalJS ('redrawWordCloud();' )
Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ if (!window.clearImmediate) {
312
312
}
313
313
314
314
/* Make sure gridSize is a whole number and is not smaller than 4px */
315
- settings . gridSize = Math . max ( Math . floor ( settings . gridSize ) , 4 ) ;
315
+ settings . gridSize = Math . max ( Math . floor ( settings . gridSize ( ) ) , 4 ) ;
316
316
317
317
/* shorthand */
318
318
var g = settings . gridSize ;
You can’t perform that action at this time.
0 commit comments