adriancooney / console.image

The one thing Chrome Dev Tools didn't need.
1.77k stars 131 forks source link

console.image log twice in console log #19

Open afiqiqmal opened 6 years ago

afiqiqmal commented 6 years ago

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

Mehvix commented 6 years ago

same issue here

nchutchind commented 5 years ago

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.

cyqsimon commented 3 years ago

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