* Calculate margin once and cache it.