Class: Cairo::Context
Overview
class ImageSurface
Instance Attribute Summary (collapse)
-
- (Object) antialias
(also: #antialias_)
def initialize.
-
- (Object) border
def initialize.
-
- (Object) dsize
def initialize.
-
- (Object) font_face(family, slant = :normal, weight = :normal)
def initialize.
-
- (Object) font_matrix
(also: #font_matrix_)
def initialize.
-
- (Object) font_options
(also: #font_options_)
def initialize.
-
- (Object) line_cap
(also: #line_cap_)
def initialize.
-
- (Object) line_dash
def initialize.
-
- (Object) line_join
(also: #line_join_)
def initialize.
-
- (Object) operator
(also: #operator_)
def initialize.
-
- (Object) size
def initialize.
Instance Method Summary (collapse)
- - (Object) arc(x, y, r, a1, a2)
- - (Object) arc_
- - (Object) arg_neg(x, y, r, a1, a2)
-
- (Object) bak(name, *args)
options: xy x y translate scale matrix state size.
- - (Object) btranslate(tx = 0, ty = 0)
- - (Object) centertext(text)
- - (Object) circle(x, y, r)
- - (Object) copy_path(flat = false)
- - (Object) copy_path_
- - (Object) curveto(x1, y1, x2, y2, x3, y3)
- - (Object) dborder=(border)
- - (Object) dmvx(x = nil)
- - (Object) dmvxy(*xy)
- - (Object) dmvy(y = nil)
- - (Object) dscale(tx = 1, ty = 1, keep = true)
-
- (Object) du(x, y = nil)
device to user (x,nil) (nil,y) (x,y).
- - (Object) fill(keep = true)
- - (Object) fill_
-
- (Object) font_face_
def initialize.
- - (Boolean) has_pos?
- - (Boolean) infill?(x, y)
-
- (Context) initialize(surface)
constructor
A new instance of Context.
- - (Object) initialize_
- - (Boolean) instroke?(x, y)
- - (Object) line(x, y, x1, y1)
- - (Object) lineno(x, y)
- - (Object) lineto(x, y)
- - (Object) mask(*args)
-
- (Object) mvx(x = nil)
def dpos; ud(*pos) end.
-
- (Object) mvxy(*xy)
alias xy_ move_to def xy_(*xy) xy.empty? ? current_point : move_to(*xy) end.
- - (Object) mvy(y = nil)
- - (Object) newline
- - (Object) newline_height
-
- (Object) paint_img(img, selection = nil, rotate = 0, scale = 1)
def bak.
- - (Object) pop
- - (Object) pop_group(to_source = false)
- - (Object) pop_group_
-
- (Object) push
push pos.
- - (Object) push_group(context = false)
- - (Object) push_group_
- - (Object) rdmvx(x)
- - (Object) rdmvxy(x, y)
- - (Object) rectangle(x, y, w, h)
-
- (Object) rectangle_
rectangle with rounded support.
- - (Object) rline(x, y, x1, y1)
- - (Object) rlineno(x, y)
- - (Object) rlineto(x, y)
- - (Object) rmvdy(y)
- - (Object) rmvx(x)
- - (Object) rmvxy(x, y)
- - (Object) rmvy(y)
- - (Object) rotate(angle)
- - (Object) rotate_
- - (Object) rrectangle(x, y, w, h)
-
- (Object) scale(*args)
args@ tx,ty,keep=true keep size border.
- - (Object) scale_
- - (Object) sep(width, border = "1")
- - (Object) set_source(source)
- - (Object) set_source_
- - (Object) showtext(text, newline = false)
- - (Object) stroke(preverse = false, &blk)
- - (Object) stroke_
-
- (Object) table(datas, oph = {})
base on scale(*wh) datas: [ [..], ].
-
- (Object) tdu(x, y = nil)
device to user distance (x,nil) (nil,y) (x,y).
- - (Object) text_scale_min
- - (Object) translate(*txy)
- - (Object) translate_
-
- (Object) tud(x, y = nil)
user_to_device_sitance (x,nil) (nil,y) (x,y).
-
- (Object) ud(x, y = nil)
user_to_device (x,nil) (nil,y) (x,y).
Constructor Details
- (Context) initialize(surface)
A new instance of Context
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/tagen/cairo.rb', line 225 def initialize(surface) initialize_(surface) move_to(0,0) self.dsize = 13 self.dborder = 1 @line_cap =line_cap_ @line_join =line_join_ @line_dash =line_dash_ @font_matrix =font_matrix_ @font_options = @font_face =font_face_ @operator =operator_ @antialias =antialias_ end |
Instance Attribute Details
- (Object) antialias Also known as: antialias_
def initialize
242 243 244 |
# File 'lib/tagen/cairo.rb', line 242 def antialias @antialias end |
- (Object) border
def initialize
242 243 244 |
# File 'lib/tagen/cairo.rb', line 242 def border @border end |
- (Object) dsize
def initialize
242 243 244 |
# File 'lib/tagen/cairo.rb', line 242 def dsize @dsize end |
- (Object) font_face(family, slant = :normal, weight = :normal)
def initialize
242 243 244 245 246 |
# File 'lib/tagen/cairo.rb', line 242 def font_face family, slant=:normal, weight=:normal slant = Cairo.const_get("font_slant_#{slant}".upcase) weight = Cairo.const_get("font_weight_#{weight}".upcase) select_font_face family, slant, weight end |
- (Object) font_matrix Also known as: font_matrix_
def initialize
242 243 244 |
# File 'lib/tagen/cairo.rb', line 242 def font_matrix @font_matrix end |
- (Object) font_options Also known as: font_options_
def initialize
242 243 244 |
# File 'lib/tagen/cairo.rb', line 242 def @font_options end |
- (Object) line_cap Also known as: line_cap_
def initialize
242 243 244 |
# File 'lib/tagen/cairo.rb', line 242 def line_cap @line_cap end |
- (Object) line_dash
def initialize
242 243 244 |
# File 'lib/tagen/cairo.rb', line 242 def line_dash @line_dash end |
- (Object) line_join Also known as: line_join_
def initialize
242 243 244 |
# File 'lib/tagen/cairo.rb', line 242 def line_join @line_join end |
- (Object) operator Also known as: operator_
def initialize
242 243 244 |
# File 'lib/tagen/cairo.rb', line 242 def operator @operator end |
Instance Method Details
- (Object) arc(x, y, r, a1, a2)
444 445 446 447 448 449 |
# File 'lib/tagen/cairo.rb', line 444 def arc(x,y,r, a1,a2) x,y=__pos(x,y) a1,a2=__angle(a1,a2) new_path # need new_path to clear prior-path arc_(x,y,r,a1,a2) end |
- (Object) arc_
443 |
# File 'lib/tagen/cairo.rb', line 443 alias arc_ arc |
- (Object) arg_neg(x, y, r, a1, a2)
452 453 454 455 456 457 |
# File 'lib/tagen/cairo.rb', line 452 def arg_neg(x,y,r, a1,a2) x,y=__pos(x,y) a1,a2=__angle(a1,a2) new_path arc_negative(x,y,r, a1,a2) end |
- (Object) bak(name, *args)
options: xy x y translate scale matrix state size
617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 |
# File 'lib/tagen/cairo.rb', line 617 def bak(name, *args) case name.to_sym # :xy x y when :xy x_, y_ = user_to_device(*current_point) yield move_to( *device_to_user(x_, y_)) when :x x_, y_ = user_to_device(*current_point) yield x = device_to_user(x_, y_)[0] y = current_point[1] move_to(x,y) when :y x_, y_ = user_to_device(*current_point) yield x = current_point[0] y = device_to_user(x_, y_)[1] move_to(x,y) # :translate scale matrix when :translate xy_d = ud(0,0) yield a = xy_d.gach(&:to_s) translate(*a) when :scale txy_d = tud(1,1) yield scale(*txy_d.gach(&:to_s)) when :matrix # combine translate and scale xy_d = ud(0,0) txy_d = tud(1,1) yield scale(*txy_d.gach(&:to_s)) translate(*xy_d.gach(&:to_s)) # state when :state save yield restore # size when :size size_ = @dsize yield self.dsize = size_ when :border border_ = @dborder yield self.dborder = border_ # all: save xy size when :all x_, y_ = user_to_device(*current_point) size_ = @dsize save yield restore move_to( *device_to_user(x_, y_)) self.dsize = size_ else raise ArgumentError, "bak(:#{name})" end end |
- (Object) btranslate(tx = 0, ty = 0)
560 |
# File 'lib/tagen/cairo.rb', line 560 def btranslate tx=0,ty=0; translate tx.to_s, ty.to_s end |
- (Object) centertext(text)
343 344 345 346 347 348 |
# File 'lib/tagen/cairo.rb', line 343 def centertext(text) advanced_x = nil advanced_x = text_extents(text.to_s).to_a[-2] mvxy( ((1-advanced_x)/2.0).to_s , '0') showtext(text, true) end |
- (Object) circle(x, y, r)
442 |
# File 'lib/tagen/cairo.rb', line 442 def circle(x,y,r); arc(x,y,r,0,360) end |
- (Object) copy_path(flat = false)
470 |
# File 'lib/tagen/cairo.rb', line 470 def copy_path(flat=false) flat ? copy_path_flat : copy_path_ end |
- (Object) copy_path_
469 |
# File 'lib/tagen/cairo.rb', line 469 alias copy_path_ copy_path |
- (Object) curveto(x1, y1, x2, y2, x3, y3)
461 462 463 464 |
# File 'lib/tagen/cairo.rb', line 461 def curveto(x1,y1, x2,y2, x3,y3) x1,y1,x2,y2,x3,y3=__pos(x1,y1,x2,y2,x3,y3) curve_to(x1,y1, x2,y2, x3,y3) end |
- (Object) dborder=(border)
491 492 493 494 495 |
# File 'lib/tagen/cairo.rb', line 491 def dborder=(border) @dborder = border @border = tdu(border) self.line_width = @border end |
- (Object) dmvx(x = nil)
425 |
# File 'lib/tagen/cairo.rb', line 425 def dmvx(x=nil); x ? dmvxy(x, "0") : ud(*current_point)[0] end |
- (Object) dmvxy(*xy)
418 |
# File 'lib/tagen/cairo.rb', line 418 def dmvxy(*xy) xy.empty? ? ud(*current_point) : move_to(*__dpos(*xy)) end |
- (Object) dmvy(y = nil)
430 |
# File 'lib/tagen/cairo.rb', line 430 def dmvy(y=nil) y ? dmvxy("0", y) : ud(*current_point)[1] end |
- (Object) dscale(tx = 1, ty = 1, keep = true)
547 |
# File 'lib/tagen/cairo.rb', line 547 def dscale tx=1,ty=1, keep=true; scale tx.to_s, ty.to_s, keep end |
- (Object) du(x, y = nil)
device to user (x,nil) (nil,y) (x,y)
593 594 595 596 597 598 599 600 601 |
# File 'lib/tagen/cairo.rb', line 593 def du(x,y=nil) if y==nil device_to_user(x,0)[0] elsif x==nil device_to_user(0,y)[1] else device_to_user(x,y) end end |
- (Object) fill(keep = true)
381 382 383 384 385 386 387 388 389 |
# File 'lib/tagen/cairo.rb', line 381 def fill(keep=true) if keep xy = current_point fill_() move_to(*xy) else fill_() end end |
- (Object) fill_
380 |
# File 'lib/tagen/cairo.rb', line 380 alias fill_ fill |
- (Object) font_face_
def initialize
251 252 253 |
# File 'lib/tagen/cairo.rb', line 251 def font_face @font_face end |
- (Boolean) has_pos?
515 |
# File 'lib/tagen/cairo.rb', line 515 def has_pos?; has_current_point? ? true : false end |
- (Boolean) infill?(x, y)
351 |
# File 'lib/tagen/cairo.rb', line 351 def infill?(x,y); in_fill?(x,y) end |
- (Object) initialize_
224 |
# File 'lib/tagen/cairo.rb', line 224 alias initialize_ initialize |
- (Boolean) instroke?(x, y)
350 |
# File 'lib/tagen/cairo.rb', line 350 def instroke?(x,y); in_stroke?(x,y) end |
- (Object) line(x, y, x1, y1)
439 |
# File 'lib/tagen/cairo.rb', line 439 def line(x,y, x1,y1) bak(:xy){mvxy(x,y); lineto(x1,y1) } end |
- (Object) lineno(x, y)
437 |
# File 'lib/tagen/cairo.rb', line 437 def lineno(x,y) bak(:xy){lineto(x,y)} end |
- (Object) lineto(x, y)
435 |
# File 'lib/tagen/cairo.rb', line 435 def lineto(x,y) line_to(*__pos(x,y) ) end |
- (Object) mask(*args)
391 392 393 394 395 396 397 |
# File 'lib/tagen/cairo.rb', line 391 def mask(*args) if args[0].class == Pattern mask(args[0]) elsif args[0].class == Surface mask_surface(*args) end end |
- (Object) mvx(x = nil)
def dpos; ud(*pos) end
424 |
# File 'lib/tagen/cairo.rb', line 424 def mvx(x=nil); x ? mvxy(x, "0") : current_point[0] end |
- (Object) mvxy(*xy)
alias xy_ move_to def xy_(*xy) xy.empty? ? current_point : move_to(*xy) end
417 |
# File 'lib/tagen/cairo.rb', line 417 def mvxy(*xy) xy.empty? ? current_point : move_to(*__pos(*xy)) end |
- (Object) mvy(y = nil)
429 |
# File 'lib/tagen/cairo.rb', line 429 def mvy(y=nil) y ? mvxy("0", y ) : current_point[1] end |
- (Object) newline
330 331 332 |
# File 'lib/tagen/cairo.rb', line 330 def newline mvxy(0, newline_height.to_s) end |
- (Object) newline_height
317 318 319 320 321 322 323 324 325 326 327 328 |
# File 'lib/tagen/cairo.rb', line 317 def newline_height out = nil; prev=nil text_scale_min do ascent, descent = font_extents.to_a out = ascent+descent prev = tud(nil, 1) end cur = tud(nil, 1) out = prev/cur*out out end |
- (Object) paint_img(img, selection = nil, rotate = 0, scale = 1)
def bak
684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 |
# File 'lib/tagen/cairo.rb', line 684 def paint_img(img, selection=nil, rotate=0, scale=1) # handle arg selection selection ||= [] select_x,select_y,select_w,select_h = selection select_x ||= 0; select_y ||= 0 select_w ||= img.w-select_x; select_h ||= img.h-select_y select_w,select_h=1,1 if select_w<=0 or select_h<=0 select_w,select_h = select_w*scale.to_f, select_h*scale.to_f select_x,select_y = select_x*scale.to_f, select_y*scale.to_f bak(:state) do # rotate translate(surface.w/2, surface.h/2) rotate(rotate) translate(-select_w/2, -select_h/2) # selection [x,y,w,h] rectangle(0,0,select_w,select_h) clip translate(-select_x,-select_y) # scale scale(scale, scale) # paint set_source(img) paint end end |
- (Object) pop
522 523 524 |
# File 'lib/tagen/cairo.rb', line 522 def pop @xy_stack.pop end |
- (Object) pop_group(to_source = false)
409 410 411 412 413 |
# File 'lib/tagen/cairo.rb', line 409 def pop_group(to_source=false) group = pop_group_ set_source(group) if to_source group end |
- (Object) pop_group_
408 |
# File 'lib/tagen/cairo.rb', line 408 alias pop_group_ pop_group |
- (Object) push
push pos
518 519 520 521 |
# File 'lib/tagen/cairo.rb', line 518 def push @xy_stack ||=[] @xy_stack.push(current_point) end |
- (Object) push_group(context = false)
400 401 402 403 404 405 406 |
# File 'lib/tagen/cairo.rb', line 400 def push_group(context=false) if context push_group_widht_context(context) else push_group_ end end |
- (Object) push_group_
399 |
# File 'lib/tagen/cairo.rb', line 399 alias push_group_ push_group |
- (Object) rdmvx(x)
427 |
# File 'lib/tagen/cairo.rb', line 427 def rdmvx x; rdmvxy(x, 0) end |
- (Object) rdmvxy(x, y)
420 |
# File 'lib/tagen/cairo.rb', line 420 def rdmvxy(x,y) move_to(*__tpos(x,y)) end |
- (Object) rectangle(x, y, w, h)
806 |
# File 'lib/tagen/cairo.rb', line 806 def rectangle(x,y,w,h) rectangle_(*__pos(x,y), *__du(w,h) ) end |
- (Object) rectangle_
rectangle with rounded support
805 |
# File 'lib/tagen/cairo.rb', line 805 alias rectangle_ rectangle |
- (Object) rline(x, y, x1, y1)
440 |
# File 'lib/tagen/cairo.rb', line 440 def rline(x,y, x1,y1) bak(:xy){rmvxy(x,y); rlineto(x1,y1)} end |
- (Object) rlineno(x, y)
438 |
# File 'lib/tagen/cairo.rb', line 438 def rlineno(x,y) bak(:xy){rlineto(x,y)} end |
- (Object) rlineto(x, y)
436 |
# File 'lib/tagen/cairo.rb', line 436 def rlineto(x,y) line_to(*__rpos(x,y)) end |
- (Object) rmvdy(y)
432 |
# File 'lib/tagen/cairo.rb', line 432 def rmvdy y; rdmvxy(0, y) end |
- (Object) rmvx(x)
426 |
# File 'lib/tagen/cairo.rb', line 426 def rmvx x; rmvxy(x, 0) end |
- (Object) rmvxy(x, y)
419 |
# File 'lib/tagen/cairo.rb', line 419 def rmvxy(x,y) move_to(*__rpos(x,y)) end |
- (Object) rmvy(y)
431 |
# File 'lib/tagen/cairo.rb', line 431 def rmvy y; rmvxy(0, y) end |
- (Object) rotate(angle)
528 |
# File 'lib/tagen/cairo.rb', line 528 def rotate(angle); rotate_(__angle(angle)) end |
- (Object) rotate_
527 |
# File 'lib/tagen/cairo.rb', line 527 alias rotate_ rotate |
- (Object) rrectangle(x, y, w, h)
807 |
# File 'lib/tagen/cairo.rb', line 807 def rrectangle(x,y,w,h) rectangle_(*__rpos(x,y), *__du(w,h) ) end |
- (Object) scale(*args)
args@ tx,ty,keep=true keep size border
533 534 535 536 537 538 539 540 541 542 543 544 545 546 |
# File 'lib/tagen/cairo.rb', line 533 def scale(*args) if args.empty? tdu 1,1 else tx, ty, keep = args keep ||= true tx,ty = __tdu(tx,ty) scale_(tx,ty) if keep self.dsize=@dsize self.dborder=@dborder end end end |
- (Object) scale_
530 |
# File 'lib/tagen/cairo.rb', line 530 alias scale_ scale |
- (Object) sep(width, border = "1")
334 335 336 337 338 339 340 341 |
# File 'lib/tagen/cairo.rb', line 334 def sep(width, border="1") mvxy(0, "0") line("0","0", width, "0") bak(:border) do self.border = border stroke end end |
- (Object) set_source(source)
354 355 356 357 358 359 360 361 362 363 364 365 366 |
# File 'lib/tagen/cairo.rb', line 354 def set_source(source) # [r,g,b,a=1.0] Pattern Surface # "#rgb[a]", "name" (set_source_color) # Pixbuf (set_source_pixbuf) case when String===source set_source_color(source) when Array===source, source.kind_of?(Pattern), source.kind_of?(Surface) set_source_(source) else set_source_pixbuf(*args) end end |
- (Object) set_source_
353 |
# File 'lib/tagen/cairo.rb', line 353 alias set_source_ set_source |
- (Object) showtext(text, newline = false)
307 308 309 310 311 312 313 314 315 |
# File 'lib/tagen/cairo.rb', line 307 def showtext(text, newline=false) text_scale_min do ascent, descent = font_extents.to_a mvxy('0', ascent.to_s) show_text(text.to_s) mvxy('0', (-ascent).to_s) mvxy(0, (ascent+descent).to_s) if newline end end |
- (Object) stroke(preverse = false, &blk)
473 474 475 476 477 |
# File 'lib/tagen/cairo.rb', line 473 def stroke(preverse=false, &blk) bak(:xy) { stroke_(preverse, &blk) } end |
- (Object) stroke_
472 |
# File 'lib/tagen/cairo.rb', line 472 alias stroke_ stroke |
- (Object) table(datas, oph = {})
base on scale(*wh) datas: [ [..], ]
718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 |
# File 'lib/tagen/cairo.rb', line 718 def table(datas, oph={}) # width height # row_nrs col_nrs cols = oph[:pos] spacing = oph[:spacing] || [4,1] spacing = tdu(*spacing) # ==>datas row_nrs and col_nrs datas = [datas] if not Array===datas[0] row_nrs = datas.size col_nrs = datas[0].size # ==> cell_height 0.05 height cell_height = newline_height + spacing[1]*2 height = cell_height * datas.size ## ==>cols [0, 0.5, 1.0] # cell_widths [text_extents..] if oph[:pos] == "<" || oph[:pos] == ">" cell_widths = [0] cell_widths += datas.transpose.gach do |cols| cols.gach{|v| text_extents(v.to_s).to_a[-2]}.max end end case oph[:pos] when "<" if oph[:border] pos = cell_widths[0]+spacing[0]*2 cols = [0, pos, pos+cell_widths[1]+spacing[0] ] else pos = cell_widths[0]+spacing[0] cols = [0, pos, pos+cell_widths[1]+spacing[0] ] end when ">" if oph[:border] pos = 1-(cell_widths[0]+cell_widths[1]+spacing[0]*4) cols = [ pos, pos+cell_widths[0]+spacing[0]*2, 1 ] else pos = 1-(cell_widths[0]+cell_widths[1]+spacing[0]*3) cols = [ pos, pos+cell_widths[0]+spacing[0], 1 ] end else cols ||= (0..col_nrs).map{|v| v/col_nrs.to_f} end width = cols[-1] # draw border if oph[:border] rectangle cols[0], "0", cols[-1], height # draw rows bak(:xy) { row_nrs.each do ry cell_height; rlineno cols[-1], 0 end } # draw cols bak(:xy) { cols.gach do |v| x v; rlineno 0, height end } stroke end # draw text datas.gach do |rows| bak(:xy) { rxy 0, spacing[1] rows.gach do |row, i| xy cols[i], "0" rx spacing[0] showtext row end } ry cell_height end [width, height] end |
- (Object) tdu(x, y = nil)
device to user distance (x,nil) (nil,y) (x,y)
605 606 607 608 609 610 611 612 613 |
# File 'lib/tagen/cairo.rb', line 605 def tdu(x,y=nil) if y==nil device_to_user_distance(x, 0)[0] elsif x==nil device_to_user_distance(0, y)[1] else device_to_user_distance(x,y) end end |
- (Object) text_scale_min
299 300 301 302 303 304 305 |
# File 'lib/tagen/cairo.rb', line 299 def text_scale_min min = tud(1,1).min bak(:scale) do dscale min, min yield end end |
- (Object) translate(*txy)
550 551 552 553 554 555 556 557 558 |
# File 'lib/tagen/cairo.rb', line 550 def translate(*txy) if txy.empty? ud 0,0 else txy_ = xy translate_(*__du(*txy)) mvxy(*txy_) end end |
- (Object) translate_
549 |
# File 'lib/tagen/cairo.rb', line 549 alias translate_ translate |
- (Object) tud(x, y = nil)
user_to_device_sitance (x,nil) (nil,y) (x,y)
579 580 581 582 583 584 585 586 587 |
# File 'lib/tagen/cairo.rb', line 579 def tud(x,y=nil) if y==nil user_to_device_distance(x, 0)[0] elsif x==nil user_to_device_distance(0, y)[1] else user_to_device_distance(x,y) end end |
- (Object) ud(x, y = nil)
user_to_device (x,nil) (nil,y) (x,y)
567 568 569 570 571 572 573 574 575 |
# File 'lib/tagen/cairo.rb', line 567 def ud(x,y=nil) if y==nil user_to_device(x,0)[0] elsif x==nil user_to_device(0,y)[1] else user_to_device(x,y) end end |