Giter Site home page Giter Site logo

Comments (18)

melloware avatar melloware commented on May 29, 2024

can you paste your before and after screenshots too please

from primefaces-extensions.

marcelocaser avatar marcelocaser commented on May 29, 2024

added images

from primefaces-extensions.

jepsar avatar jepsar commented on May 29, 2024

@melloware do you want me to have a look?

from primefaces-extensions.

melloware avatar melloware commented on May 29, 2024

yep looks like a regression of this issue: primefaces-extensions/primefaces-extensions.github.com#695

attached test case: https://github.com/primefaces-extensions/primefaces-extensions.github.com/files/3141695/pfe-la.zip

from primefaces-extensions.

melloware avatar melloware commented on May 29, 2024

assigned to you @jepsar

from primefaces-extensions.

jepsar avatar jepsar commented on May 29, 2024

I cannot fully reproduce this. I added this to the showcase:

<p:dataTable value="#{['Optimus Prime','PrimeFaces Extensions']}" var="name">
    <p:column headerText="Name">
        <pe:letterAvatar value="#{name}" size="1rem" rounded="false"/>
        #{name}
    </p:column>
</p:dataTable>

which renders as

Screen Shot 2020-09-29 at 16 56 50

The line height is not perfect, but that's all (it seems). (Chrome Version 85.0.4183.121 (Official Build) (64-bit) on MacOS).

from primefaces-extensions.

melloware avatar melloware commented on May 29, 2024

what happens when you update="datatable" same as sorting or paging or filtering

from primefaces-extensions.

jepsar avatar jepsar commented on May 29, 2024

Screen Shot 2020-09-29 at 17 05 56

Looks the same..

from primefaces-extensions.

melloware avatar melloware commented on May 29, 2024

Agreed I can't reproduce...
pfe-la.zip

However I do notice the color spread is not that great?

image

from primefaces-extensions.

jepsar avatar jepsar commented on May 29, 2024

However I do notice the color spread is not that great?

Caused by:

    public static int hue(final String str) {
        return Math.abs(hash(str) % 360);
    }

This is giving you all the possible hue values. A better spread would be something like:

    public static int hue(final String str) {
        return Math.abs((hash(str) % 60) * 6);
    }

which gives 60 possibilities instead of all 360.

from primefaces-extensions.

melloware avatar melloware commented on May 29, 2024

maybe do 60 if string length == 1 and 360 for all others?

from primefaces-extensions.

melloware avatar melloware commented on May 29, 2024

oh i actually like your solution better. i see the * 6 now

from primefaces-extensions.

jepsar avatar jepsar commented on May 29, 2024

Also, I think we can simply use string.hashCode() instead of calculating a hash.

from primefaces-extensions.

jepsar avatar jepsar commented on May 29, 2024

I'll do some tweaks, but that won't fix the reported issue. I don't think there were changes between 8.0.4 and 9.0.

from primefaces-extensions.

melloware avatar melloware commented on May 29, 2024

up to you! yeah i think this is a non issue.

from primefaces-extensions.

marcelocaser avatar marcelocaser commented on May 29, 2024

Look: with sample (pfe-la.zip)

<pe:letterAvatar value="#{car.brand}" height="24" width="24" rounded="false"/>
Opera Instantâneo_2020-09-29_123057_localhost

<pe:letterAvatar value="#{car.brand}" size="1rem" rounded="false"/>
Opera Instantâneo_2020-09-29_123203_localhost

from primefaces-extensions.

jepsar avatar jepsar commented on May 29, 2024

@marcelocaser can you please inspect the inner span with class ui-letteravatar-initials and disable the top property. Does that solve the issue for you?

from primefaces-extensions.

jepsar avatar jepsar commented on May 29, 2024

Screen Shot 2020-09-29 at 17 37 13

from primefaces-extensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.