Skip to content

Commit 3e17cf6

Browse files
author
runrevben
committed
Tweaks
1 parent 6af5cf7 commit 3e17cf6

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

extensions/widgets/gradientrampeditor/gradientrampeditor.lcb

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ metadata title is "Gradient Ramp Editor"
2121
metadata author is "LiveCode"
2222
metadata version is "0.0.1"
2323
metadata svgicon is "M65.4,8.5v-7C65.4,0.6,64.8,0,64,0h-5.7c-0.8,0-1.4,0.6-1.4,1.4v7c0,0.6,0.2,1.1,0.6,1.5l3.3,3.5H34.6l3.3-3.5c0.4-0.4,0.6-0.9,0.6-1.5v-7c0-0.8-0.6-1.4-1.4-1.4h-5.7C30.6,0,30,0.6,30,1.4v7c0,0.6,0.2,1.1,0.6,1.5l3.3,3.5h-29L8.2,10C8.6,9.6,8.8,9,8.8,8.5v-7C8.8,0.6,8.2,0,7.4,0H1.6C0.8,0,0.2,0.6,0.2,1.4v7C0.2,9,0.4,9.6,0.8,10l3.3,3.5H0v15.3h4l-3.2,3.4c-0.4,0.4-0.6,0.9-0.6,1.5v7c0,0.8,0.6,1.4,1.4,1.4h5.7c0.8,0,1.4-0.6,1.4-1.4v-7c0-0.6-0.2-1.1-0.6-1.5L5,28.8h28.9l-3.2,3.4c-0.4,0.4-0.6,0.9-0.6,1.5v7c0,0.8,0.6,1.4,1.4,1.4h5.7c0.8,0,1.4-0.6,1.4-1.4v-7c0-0.6-0.2-1.1-0.6-1.5l-3.2-3.4h25.8l-3.2,3.4c-0.4,0.4-0.6,0.9-0.6,1.5v7c0,0.8,0.6,1.4,1.4,1.4H64c0.8,0,1.4-0.6,1.4-1.4v-7c0-0.6-0.2-1.1-0.6-1.5l-3.2-3.4h3.8V13.4h-3.9l3.3-3.5C65.2,9.6,65.4,9,65.4,8.5z M31.5,7.2V1.7H37v5.6H31.5z M1.7,7.2V1.7h5.6v5.6H1.7z M7.3,34.8v5.6H1.7v-5.6H7.3z M19,25.6v-9h3.1v9H19z M37.2,34.8v5.6h-5.6v-5.6H37.2z M33.4,25.6v-9h3.2v9H33.4z M44.1,25.6v-9h3.2v9H44.1z M52,25.6v-9h2.9v9H52z M57.3,25.6v-9h2.1v9H57.3z M63.9,34.8v5.6h-5.6v-5.6H63.9z M62.5,16.6v9h-2v-9H62.5z M63.9,7.2h-5.6V1.7h5.6V7.2z"
24-
24+
metadata preferredSize is "275,115"
25+
2526
use com.livecode.widget
2627
use com.livecode.canvas
2728

@@ -252,7 +253,24 @@ public handler OnKeyPress(in pKey as String) returns nothing
252253
end if
253254
end handler
254255

255-
private handler onPaintCheckerboard() returns nothing
256+
public handler OnPaint() returns nothing
257+
-- Draw the checker board that we place behind the gradient.
258+
paintCheckerboard()
259+
260+
-- Draw the gradient on top of the checkerboard.
261+
paintGradient()
262+
263+
-- Draw the ruler above and below the gradient.
264+
paintRulerBottom()
265+
266+
-- Draw the ramp points on top of the ruler.
267+
paintRampEditors()
268+
end handler
269+
270+
----------------------------------------------------------------------------------------------------
271+
-- Private handlers
272+
----------------------------------------------------------------------------------------------------
273+
private handler paintCheckerboard() returns nothing
256274
-- Fill the entire widget canvas with the checkerboard then clip to the gradient region.
257275
variable tY as Real
258276
variable tX as Real
@@ -284,7 +302,7 @@ private handler onPaintCheckerboard() returns nothing
284302
end layer on this canvas
285303
end handler
286304

287-
private handler onPaintGradient() returns nothing
305+
private handler paintGradient() returns nothing
288306
variable tGradient as Gradient
289307
put linear gradient with ramp mGradientRamp into tGradient
290308
set the from of tGradient to point [the left of mGradientRectangle, (the top of mGradientRectangle + the bottom of mGradientRectangle) / 2]
@@ -295,7 +313,7 @@ private handler onPaintGradient() returns nothing
295313
fill this canvas
296314
end handler
297315

298-
private handler onPaintRulerBottom() returns nothing
316+
private handler paintRulerBottom() returns nothing
299317
variable tY as Real
300318
variable tX as Real
301319

@@ -337,7 +355,7 @@ private handler onPaintRulerBottom() returns nothing
337355
end repeat
338356
end handler
339357

340-
private handler onPaintRampEditors() returns nothing
358+
private handler paintRampEditors() returns nothing
341359
variable tY as Real
342360
variable tX as Real
343361
variable tStopIndex as Integer
@@ -415,24 +433,6 @@ private handler onPaintRampEditors() returns nothing
415433
end repeat
416434
end handler
417435

418-
public handler OnPaint() returns nothing
419-
-- Draw the checker board that we place behind the gradient.
420-
onPaintCheckerboard()
421-
422-
-- Draw the gradient on top of the checkerboard.
423-
onPaintGradient()
424-
425-
-- Draw the ruler above and below the gradient.
426-
onPaintRulerBottom()
427-
428-
-- Draw the ramp points on top of the ruler.
429-
onPaintRampEditors()
430-
end handler
431-
432-
----------------------------------------------------------------------------------------------------
433-
-- Private handlers
434-
----------------------------------------------------------------------------------------------------
435-
436436
private handler gradientStopsChanged() returns nothing
437437
post "gradientStopsChanged" to my script object
438438
end handler

0 commit comments

Comments
 (0)