Fix scaling of custom markers [backport to 1.4.x]

See also #3441.