Giter VIP home page Giter VIP logo

Comments (4)

kobalicek avatar kobalicek commented on August 24, 2024 1

Yeah the current roadmap is here:

In general all features mentioned on roadmap are planned, and those blue (in progress) have high priority and the work has already started.

from blend2d.

squrky avatar squrky commented on August 24, 2024

Apologies, this problem is actually not about glyphs, as the above images show the clipping is also not being correctly applied to simple lines and rectangle strokes.

This simplified code listing demonstrates:

// Outer and inner rectangles
const BLRect outer_rect{0, 0, 50, 100};
const BLRect inner_rect{-30, -30, 60, 60};

// Make test image and context
const auto test_width = 200;
const auto test_height = 200;
BLImage img(test_width, test_height, BL_FORMAT_PRGB32);
BLContext ctx(img);
ctx.clearAll();

// Draw image boundary
ctx.setStrokeStyle(BLRgba32{255, 255, 0, 255});
ctx.strokeRect(BLRect{0, 0, test_width, test_height});

// Move the origin to the centre of the image
const auto origin_x = test_width * 0.5;
const auto origin_y = test_height * 0.5;
ctx.translate(origin_x, origin_y);

// Rotate everything around the centre 
const auto degrees = 35.0;
static const constexpr double to_radians = 3.1415926535 / 180;
ctx.rotate(degrees * to_radians); // <<-------- ROTATE

// Clip with inner rectangle
ctx.clipToRect(inner_rect); // <<--------------- CLIP

// Position rectangles over the origin
ctx.save();
ctx.translate(-outer_rect.w * 0.5, -outer_rect.h * 0.5);

// Draw outer rect and lines
ctx.setStrokeStyle(BLRgba32(0, 128, 255, 255));
ctx.strokeRect(outer_rect);
ctx.strokeLine(BLLine{0, 0, outer_rect.w, outer_rect.h});
ctx.strokeLine(BLLine{0, outer_rect.h, outer_rect.w, 0});
ctx.restore();

// Draw inner rect used for clipping
ctx.setStrokeStyle(BLRgba32(255, 0, 0, 255));
ctx.strokeRect(inner_rect);

And the result:
test

The actual clipping is performed inside what seems suspiciously similar to the screen-space extents of the transformed clipping rect.

from blend2d.

kobalicek avatar kobalicek commented on August 24, 2024

This is an unimplemented feature at the moment. It's on the roadmap, I will focus on this after new stroking engine is merged.

from blend2d.

squrky avatar squrky commented on August 24, 2024

Thanks. Out of interest, do you publish your development roadmap anywhere?

from blend2d.

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.