Coder Social home page Coder Social logo

Comments (5)

sebasmonia avatar sebasmonia commented on August 16, 2024

I got it working by changing telephone-line-separator-render-image to this:

(cl-defmethod telephone-line-separator-render-image ((obj telephone-line-separator) foreground background)
  "Find cached pbm of OBJ in FOREGROUND and BACKGROUND.
If it doesn't exist, create and cache it."
  (let* ((height (or telephone-line-height (frame-char-height)))
         (hash-key (format "%s_%s_%s" background foreground height)))
    ;; Return cached image if we have it.
    (or (gethash hash-key (oref obj image-cache))
        (puthash hash-key
                 (telephone-line-propertize-image
                  (telephone-line--create-pbm-image
                   (telephone-line-separator-create-body obj)
                   background foreground))
                 (oref obj image-cache)))))

but now I get a small render defect in one of the monitors, see the attach.
(Also I think I should use something else to get the height, there's already a method define in utils to get the height but I was just testing :))
2019-05-28 09_57_13-Microsoft Edge

from telephone-line.

sebasmonia avatar sebasmonia commented on August 16, 2024

Strangely at work with 3 completely different resolutions (4K, retina-like, and laptop), it renders perfectly in all screens!

from telephone-line.

dbordak avatar dbordak commented on August 16, 2024

Oh, hey, adding font height to the cache key is a great idea.

from telephone-line.

sebasmonia avatar sebasmonia commented on August 16, 2024

Awesome. I have another PR in the pipeline (that as per another issue, could convert to a Wiki entry rather than MOAR SEGMENTS, up to you).

I won't add this to the same PR as they are completely different issues, but will submit one right after. Also, I think I need to call one of the methods defined instead of repeating the "height selection" logic.

from telephone-line.

sebasmonia avatar sebasmonia commented on August 16, 2024

This was merged in #104, closing the issue. Thank you!

from telephone-line.

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.