Ignore:
Timestamp:
Feb 19, 2023, 2:33:51 AM (3 years ago)
Author:
Alex Taylor
Message:

Various updates and refactoring of font scaling logic; documentation and WIS updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/printer/manager/PRINTOOL.VRX

    r94 r97  
    524524RETURN _count
    525525
    526 /*:VRX         GetScalingFactor
    527 */
    528 /* Return the UI scaling factor based on the difference between the specified
    529  * font size and the design-default font size.
    530  */
    531 GetScalingFactor: PROCEDURE EXPOSE globals.
    532     PARSE ARG newSize, orgSize
    533 
    534     IF orgSize == '' THEN
    535         orgSize = globals.!defaultSize
    536 
    537     IF newSize < globals.!defaultSize THEN
    538         newSize = globals.!defaultSize
    539 
    540     scaleFactor = newSize / orgSize
    541 
    542 RETURN scaleFactor
    543 
    544526/*:VRX         GetShippedDrivers
    545527*/
     
    13591341
    13601342RETURN ok
    1361 
    1362 /*:VRX         ParseFontSize
    1363 */
    1364 ParseFontSize: PROCEDURE EXPOSE globals.
    1365     PARSE ARG font
    1366     IF font == '' | font == '<default>' THEN
    1367         RETURN globals.!defaultSize
    1368 
    1369     PARSE VAR font _pts'.'.
    1370     IF _pts < globals.!defaultSize THEN
    1371         _pts = globals.!defaultSize
    1372 
    1373 RETURN _pts
    13741343
    13751344/*:VRX         PB_ABOUT_OK_Click
     
    22812250RETURN
    22822251
    2283 /*:VRX         RescaleObject
    2284 */
    2285 RescaleObject: PROCEDURE
    2286     PARSE ARG object, factor, move
    2287 
    2288     x = VRGet( object, 'Left')
    2289     y = VRGet( object, 'Top')
    2290     w = VRGet( object, 'Width')
    2291     h = VRGet( object, 'Height')
    2292     nx = TRUNC( x * factor )
    2293     ny = TRUNC( y * factor  )
    2294     nw = TRUNC( w * factor )
    2295     nh = TRUNC( h * factor  )
    2296 
    2297     /* SAY object ': ('||x','y','w','h') --> ('nx','ny','nw','nh')' */
    2298 
    2299     IF move <> 0 THEN DO
    2300         ok = VRSet( object, 'Left', nx )
    2301         ok = VRSet( object, 'Top', ny )
    2302     END
    2303     ok = VRSet( object, 'Width', nw )
    2304     ok = VRSet( object, 'Height', nh )
    2305 
    2306 RETURN
    2307 
    23082252/*:VRX         SetDriverList
    23092253*/
Note: See TracChangeset for help on using the changeset viewer.