Overview
Comment: | Fixed getting extents |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.61 |
Files: | files | file ages | folders |
SHA1: |
e32e49b9abdfa57c0f9ac8b726f2f0c9 |
User & Date: | matt on 2016-07-14 23:31:14 |
Other Links: | branch diff | manifest | tags |
Context
2016-07-15
| ||
00:18 | dashboard compiles now check-in: e13bddd3c6 user: matt tags: v1.61 | |
2016-07-14
| ||
23:31 | Fixed getting extents check-in: e32e49b9ab user: matt tags: v1.61 | |
03:50 | Getting extents check-in: 04f3e0f7d5 user: matt tags: v1.61 | |
Changes
Modified vg-test.scm from [90d7b39a30] to [af708285e8].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | + + + + + - - + + + + + + + + + + + + + - + | (use canvas-draw iup) (import canvas-draw-iup) (load "vg.scm") (use trace) (trace vg:draw-rect) (define d1 (vg:drawing-new)) (define l1 (vg:lib-new)) (define c1 (vg:comp-new)) (define c2 (vg:comp-new)) (let ((r1 (vg:make-rect 20 20 40 40)) (r2 (vg:make-rect 40 40 80 80))) (vg:add-objs-to-comp c1 r1 r2)) ;; add the c1 component to lib l1 with name firstcomp (vg:add-comp-to-lib l1 "firstcomp" c1) (vg:add-comp-to-lib l1 "secondcomp" c2) ;; add the l1 lib to drawing with name firstlib (vg:add-lib d1 "firstlib" l1) ;; instantiate firstlib/firstcomp as inst1 in drawing d1 at 0,0 (vg:instantiate d1 "firstlib" "firstcomp" "inst1" 0 0) (vg:instantiate d1 "firstlib" "firstcomp" "inst2" 200 200) |
Modified vg.scm from [40e90c99ca] to [12a91a7e84].
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - + | ;; ;; Copyright 2016 Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. ;; strftime('%m/%d/%Y %H:%M:%S','now','localtime') |
︙ | |||
211 212 213 214 215 216 217 218 219 220 221 222 | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - - + + - - + + + - - + + + - + + + + - + | text: (vg:obj-text obj) line-color: (vg:obj-line-color obj) font: (vg:obj-font obj))) (pts (vg:obj-pts obj))) (vg:obj-pts-set! res (vg:drawing-inst-apply-scale-offset drawing inst pts)) (vg:drawing-cache-set! drawing (cons res (vg:drawing-cache drawing) )) res)) ;;====================================================================== ;; instances ;;====================================================================== (define (vg:instances-get-extents drawing . instance-names) (let ((xtnt-lst (vg:draw drawing #f)) (llx #f) (lly #f) (ulx #f) (uly #f)) (for-each (lambda (extents) (let* ((ollx (list-ref extents 0)) (olly (list-ref extents 1)) (oulx (list-ref extents 2)) (ouly (list-ref extents 3))) (if (or (not llx)(< ollx llx))(set! llx ollx)) (if (or (not lly)(< olly lly))(set! lly olly)) (if (or (not ulx)(> oulx ulx))(set! ulx oulx)) (if (or (not uly)(> ouly uly))(set! uly ouly)))) xtnt-lst) (list llx lly ulx uly))) ;;====================================================================== ;; Unravel and draw the objects ;;====================================================================== ;; with get-extents = #t return the extents ;; with draw = #f don't actually draw the object ;; |