adriancooney / console.image

The one thing Chrome Dev Tools didn't need.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

console.image log twice in console log

afiqiqmal opened this issue · comments

commented

console.image log twice in console log

console.meme("Not sure if memes in dev tools is stupid", "or disastrous.", "Not Sure Fry");

see this screenshot : https://image.ibb.co/jqWope/Screen_Shot_2018_09_05_at_4_08_49_PM.png

same issue here

I'm not sure what the actual solution is, since it seems to be related to Chrome changing how things work in the console, but I have found how to fix it if you're comfortable changing the code on your end.

In the getBox method, padding is applied to make room for the image, and the top/bottom padding is what's making the box too big and causing the background to repeat. If you change the following line:

style: "font-size: 1px; padding: " + Math.floor(height/2) + "px " + Math.floor(width/2) + "px; line-height: " + height + "px;"

to

style: "font-size: 1px; padding: 0 " + Math.floor(width/2) + "px; line-height: " + height + "px;"

then it will work as normal.

In case you are lazy you can use this fork I found.
It works quite crudely (by dividing height by 2...) but works nonetheless.
See #22