time | Calls | line |
---|
| | 1 | function topos = convertUnits(viewport, tounits, fromunits, frompos)
|
| | 2 | % This is an undocumented function and may be removed in a future release.
|
| | 3 |
|
| | 4 | % Use the matlab.graphics.general.UnitPosition object "viewport" to convert
|
| | 5 | % the units of "frompos" from "fromunits" to "tounits".
|
| | 6 |
|
| | 7 | % Copyright 2018 The MathWorks, Inc.
|
| | 8 |
|
| | 9 | % Set the 'Units' and 'Position' to the starting units and position.
|
0.037 | 368 | 10 | viewport.Units = fromunits;
|
0.006 | 368 | 11 | viewport.Position = frompos;
|
| | 12 |
|
| | 13 | % Set the 'Units' to the new units, this will trigger a unit conversion.
|
0.006 | 368 | 14 | viewport.Units = tounits;
|
| | 15 |
|
| | 16 | % Read back the new position in the new units.
|
0.004 | 368 | 17 | topos = viewport.Position;
|
| | 18 |
|
0.002 | 368 | 19 | end
|
Other subfunctions in this file are not included in this listing.