added functions for masked drawing of sized elements