canvas: add helper to get translation of canvas.Elements.
This commit is contained in:
parent
71c4c85511
commit
313175b943
1 changed files with 8 additions and 0 deletions
|
@ -209,6 +209,14 @@ var Element = {
|
|||
},
|
||||
# Shortcut for setting translation
|
||||
setTranslation: func { me._getTf().setTranslation(arg); return me; },
|
||||
# Get translation set with #setTranslation
|
||||
getTranslation: func()
|
||||
{
|
||||
if( me['_tf'] == nil )
|
||||
return [0, 0];
|
||||
|
||||
return [me._tf.e.getValue(), me._tf.f.getValue()];
|
||||
},
|
||||
# Set rotation around transformation center (see #setCenter).
|
||||
#
|
||||
# @note This replaces the the existing transformation. For additional scale or
|
||||
|
|
Loading…
Reference in a new issue