fix: fixed bug in calculate opacity