Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

rotating yellow selector blocks too much of image #224

Open
nanodan opened this issue Aug 29, 2020 · 2 comments
Open

rotating yellow selector blocks too much of image #224

nanodan opened this issue Aug 29, 2020 · 2 comments

Comments

@nanodan
Copy link

nanodan commented Aug 29, 2020

The rotating yellow sector rect blocks a good chunk of my images (~270x270px) after being selected so that its impossible to see image details and the metadata in infoCard. The rects are dynamically created under a shadowRoot so there's no way i can find to override their properties and adjust them.

@nanodan
Copy link
Author

nanodan commented Aug 29, 2020

Was able to hack in some JS to modify the style on clicks, if anyone else needs a quick fix:

document.getElementById("elem").addEventListener("click", function(e) {
    var rects = document.getElementById("elem").shadowRoot.getElementById("vis").shadowRoot.getElementById("holder").querySelectorAll("rect")
    for (var i=0; i<rects.length; i++) {
        if (rects[i].className.baseVal === "rotate") {
            rects[i].style.strokeWidth = "0.05px";
            rects[i].style.x = -0.65;
            rects[i].style.y = -0.65;
            rects[i].style.width = 1.23;
            rects[i].style.height = 1.23;
            rects[i].style.stroke = '#ea184d'
        }
    }

@markddesimone
Copy link

Thank you! was missing final closing });

		  document.getElementById("elem").addEventListener("click", function(e) {
			var rects = document.getElementById("elem").shadowRoot.getElementById("vis").shadowRoot.getElementById("holder").querySelectorAll("rect")
			for (var i=0; i<rects.length; i++) {
				if (rects[i].className.baseVal === "rotate") {
					rects[i].style.strokeWidth = "0.05px";
					rects[i].style.x = -0.65;
					rects[i].style.y = -0.65;
					rects[i].style.width = 1.23;
					rects[i].style.height = 1.23;
					rects[i].style.stroke = '#ea184d'
				}
			}
		});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants