The width and height of the castbar border texture is hard coded and not relative:
Code:
<Texture name="$parentBorder" file="Interface\CastingBar\UI-CastingBar-Border">
<Size>
<AbsDimension x="256" y="64"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="28"/>
</Offset>
</Anchor>
You'll have to set the texture relative to the castbar frame.
Unfortunately the texture has to be a little bit larger than the castbar frame (the border has to be outside the statusbar ... not inside).
Code:
getglobal(c:GetName().."Border"):ClearAllPoints()
getglobal(c:GetName().."Border"):SetPoint("TOPLEFT", "CastingBarFrame", "TOPLEFT", -(c:GetWidth()*0.18), c:GetHeight()*1.1)
getglobal(c:GetName().."Border"):SetPoint("BOTTOMRIGHT", "CastingBarFrame", "BOTTOMRIGHT", c:GetWidth()*0.18, -(c:GetHeight()*1.1))
Guess you'll have to set new points for all other elements of the castbar frame too.