octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #58181] MATLAB function getpixelposition() mis


From: Guillaume
Subject: [Octave-bug-tracker] [bug #58181] MATLAB function getpixelposition() missing
Date: Wed, 15 Apr 2020 11:40:42 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Follow-up Comment #1, bug #58181 (project octave):

Jip: a starting point?


function pos = getpixelposition (h, recursive)

  if (nargin < 1) || (!isscalar (h)) || (! ishghandle (h))
    print_usage ();
  endif
  if (nargin < 2)
    recursive = false;
  endif

  units = get (h, "Units");
  unwind_protect
    set (h, "Units", "pixels");
    pos = get (h, "Position");
  unwind_protect_cleanup
    set (h, "Units", units);
  end_unwind_protect

  if (recursive)
    p = get (h, "Parent");
    if (! isfigure (p))
      pos(1:2) += getpixelposition (p, recursive)(1:2);
    else
      pos(1:2) += 1;
    endif
  endif

endfunction


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58181>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]