if (anchor == Anchor.LEADING) {
layer.setAttribute("top", bounds.top() + "px");
layer.setAttribute("height", bounds.height + "px");
}
if (anchor == Anchor.TRAILING) {
layer.setAttribute("bottom", getBounds().height - bounds.bottom() + "px");
layer.setAttribute("height", bounds.height + "px");
}
if (anchor == Anchor.BOTH) {
layer.setAttribute("top", bounds.top() + "px");
layer.setAttribute("bottom", getBounds().height - bounds.bottom() + "px");