I'm trying to integrate the Dirac delta of the polar rose $r(\theta)=\sin(2\theta)$, i.e. $$\delta(r-\sin(2\theta)).$$ If my reasoning isn't wrong right from the beginning, this should give me the perimeter of the polar rose just like $\delta(r-R)$ integrated in polar coordinates gives me the perimeter of a cirlce with radius $R$. But if I integrate $$\int_0^{2\pi}d\theta\int_0^\infty dr\,r\delta(r-\sin(2\theta))$$ it becomes zero:$$\int_0^{2\pi}d\theta\int_0^\infty dr\,r\delta(r-\sin(2\theta))=\int_0^{2\pi}d\theta\,\sin(2\theta)=0.$$ Of course this is not true and in fact, the perimeter of the polar rose equals $8E(3/4)$, where $E(m)$ is the complete elliptic integral of the second kind. One thing that also confuses me, is that the similar approach with $\Theta(r-\sin(2\theta))$ (i.e. computing the area of the polar rose) gives the right result: $$\int_0^{2\pi}d\theta\int_0^\infty dr\,r\Theta(r-\sin(2\theta))=\int_0^{2\pi}d\theta\int_0^{\sin(2\theta)} dr\,r=\int_0^{2\pi}d\theta\,\frac{\sin^2(2\theta)}{2}=\frac{\pi}{2}.$$ I also tried looking at the cartesian form of the polar rose $(x^2+y^2)^3=4x^2y^2$ and compute the Dirac delta form there, bat in the end it boils down to the same result.
There is probably a problem with my approach, but as of now, I'm unable to see where I'm wrong. I also already looked at the questions Integrating the Dirac Delta Function and Compute area of a sphere through a Dirac delta but had no luck.