惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
小众软件
小众软件
V
V2EX
博客园 - Franky
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
量子位
博客园 - 【当耐特】
雷峰网
雷峰网
WordPress大学
WordPress大学
Jina AI
Jina AI
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
Hugging Face - Blog
Hugging Face - Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
Visual Studio Blog
Microsoft Security Blog
Microsoft Security Blog

Martin Owens activity

Martin Owens deleted project branch average-color-divide at Inkscape / inkscape Fix divide-by-zero crash when using calligraphy tool (d34276f8) · Commits · Inkscape / inkscape · GitLab Fix divide-by-zero crash when using calligraphy tool (!7923) · Merge requests · Inkscape / inkscape · GitLab Add selection file to bypass Windows command length limits (correction) (865df7a5) · Commits · Inkscape / inkscape · GitLab Draft: Fix AppImage crashing during save on older distros (!7922) · Merge requests · Inkscape / inkscape · GitLab e71fa7f8e0858aab87b7fc0814a30a8c88da9b43 to fe225a6b9e1042c7221d95173be22a02b3725337 · Martin Owens / inkscape · GitLab 403 Forbidden on Inkscape web server (#693) · Issues · Inkscape / inkscape-web · GitLab 403 Forbidden on Inkscape web server (#13509) · Issues · Inkscape / Inbox · GitLab Add selection file to bypass Windows command length limits (correction) (!7917) · 合并请求 · Inkscape / inkscape · GitLab Non-vertical axonometric axis implementation (!7912) · Merge requests · Inkscape / inkscape · GitLab Update split mode on tab switch (!7915) · Merge requests · Inkscape / inkscape · GitLab inset/offset as app functions so they can be used from CLI (!7914) · Merge requests · Inkscape / inkscape · GitLab Performace regresion in last month (#5879) · Issues · Inkscape / inkscape · GitLab [Regression] Right-aligned text has a new gap in 1.4.4 (#6130) · Issues · Inkscape / inkscape · GitLab [Regression] Right-aligned text has a new gap in 1.4.4 (#13498) · Issues · Inkscape / Inbox · GitLab c503804e014994d611de1b225bee8158c06448a8 to a4588d8ead1e7049b90c5a126962746ed286ab17 · Inkscape / inkscape-web · GitLab Validate the extensions of signature file uploads (a4588d8e) · 提交 · Inkscape / inkscape-web · GitLab Allow color conversions using static arrays instead of just vectors (e71fa7f8) · 提交 · Martin Owens / inkscape · GitLab Speed up ungroup on thousands of items (!7908) · Merge requests · Inkscape / inkscape · GitLab Incorrect handling of FontMatrix and transformation matrices with internal PDF import (#4845) · Issues · Inkscape / inkscape · GitLab Handling edge case of negative fonts in PDF (59040229) · 提交 · Inkscape / inkscape · GitLab Handling edge case of negative fonts in PDF (!7911) · 合并请求 · Inkscape / inkscape · GitLab Allow color conversions using static arrays instead of just vectors (33e65d1b) · Commits · Martin Owens / inkscape · GitLab Allow color conversions using static arrays instead of just vectors (9be5f867) · Commits · Martin Owens / inkscape · GitLab a9672ea1dff483b5b3aa8c6b5d88cd223001bef5 to 512a5e57602ac52e1d35782a7dcebae04262b2b8 · Martin Owens / inkscape · GitLab Add selection file to bypass Windows command length limits (!7905) · 合并请求 · Inkscape / inkscape · GitLab Revert Pango label changes (1.4.x) (!7907) · 合并请求 · Inkscape / inkscape · GitLab Crash on selecting a `<text>` object without a `<tspan>` inside (#5462) · Issues · Inkscape / inkscape · GitLab Fix breakage with Ubuntu 26.04 CI (!7904) · 合并请求 · Inkscape / inkscape · GitLab c673fdd5148253276826d4eda3951daaefb82607 to 356b31383ba324396a225686613236484305533d · Martin Owens / inkscape · GitLab
Cleanup SPIFloat and default values in styles (b233c4c0) ...
Martin Owens · 2026-04-19 · via Martin Owens activity
Commit b233c4c0 authored by Martin Owens's avatar Martin Owens 🕘
Browse files
Remove remaining uses of SCALE24_TO_FLOAT and FROM_FLOAT macros which were only
used for SPIFloat and can easily be folded into the object itself.

Harmonize the default data type use with SPIEnum, SPILength and SPIFontSize
this allows the rendering engine nr-style.cpp to use the right rendering value
which is always the computed value and not need to think about the internal
implementation of the style variable between `value`, `computed` and will allow
these variable to be made private in the future.

Mikekov: Add `as_double` and `as_enum` getter functions for the new explicit interface.
+3 −3
Original line number Diff line number Diff line
@@ -492,7 +492,7 @@ objects_query_fillstroke (const std::vector<SPItem*> &objects, SPStyle *style_re
        // 2. Sum color, copy server from paint to paint_res
        if (paint_res->set && paint->isColor()) {
            auto copy = paint->getColor();
            copy.addOpacity(isfill ? style->fill_opacity : style->stroke_opacity);
            copy.addOpacity(isfill ? style->fill_opacity.as_double() : style->stroke_opacity.as_double());

            if (colors.isEmpty()) {
                paint_res->setColor(copy);
@@ -570,7 +570,7 @@ objects_query_opacity (const std::vector<SPItem*> &objects, SPStyle *style_res)
            continue;
        }

        double opacity = SP_SCALE24_TO_FLOAT(style->opacity.value);
        double opacity = style->opacity.as_double();
        opacity_sum += opacity;
        if (opacity_prev != -1 && opacity != opacity_prev) {
            same_opacity = false;
@@ -582,7 +582,7 @@ objects_query_opacity (const std::vector<SPItem*> &objects, SPStyle *style_res)
        opacity_sum /= opacity_items;
    }

    style_res->opacity.value = SP_SCALE24_FROM_FLOAT(opacity_sum);
    style_res->opacity.set_double(opacity_sum);

    if (opacity_items == 0) {
        return QUERY_STYLE_NOTHING;
+1 −1
Original line number Diff line number Diff line
@@ -345,7 +345,7 @@ DrawingItem *DrawingShape::_pickItem(Geom::Point const &p, double delta, unsigne
    bool outline = flags & PICK_OUTLINE;
    bool pick_as_clip = flags & PICK_AS_CLIP;

    if (SP_SCALE24_TO_FLOAT(style_opacity) == 0 && !outline && !pick_as_clip && !_drawing.selectZeroOpacity()) {
    if (style_opacity == 0 && !outline && !pick_as_clip && !_drawing.selectZeroOpacity()) {
        // fully transparent, no pick unless outline mode
        return nullptr;
    }
+17 −17
Original line number Diff line number Diff line
@@ -124,9 +124,9 @@ NRStyleData::NRStyleData(SPStyle const *style, SPStyle const *context_style)
    }

    fill.set(style_fill);
    fill.opacity = style->fill_opacity;
    fill.opacity = style->fill_opacity.as_double();

    switch (style->fill_rule.computed) {
    switch (style->fill_rule.as_enum()) {
        case SP_WIND_RULE_EVENODD:
            fill_rule = CAIRO_FILL_RULE_EVEN_ODD;
            break;
@@ -153,10 +153,10 @@ NRStyleData::NRStyleData(SPStyle const *style, SPStyle const *context_style)
    }

    stroke.set(style_stroke);
    stroke.opacity = SP_SCALE24_TO_FLOAT(style->stroke_opacity.value);
    stroke_width = style->stroke_width.computed;
    stroke.opacity = style->stroke_opacity.as_double();
    stroke_width = style->stroke_width.as_double();
    hairline = style->stroke_extensions.hairline;
    switch (style->stroke_linecap.computed) {
    switch (style->stroke_linecap.as_enum()) {
        case SP_STROKE_LINECAP_ROUND:
            line_cap = CAIRO_LINE_CAP_ROUND;
            break;
@@ -169,7 +169,7 @@ NRStyleData::NRStyleData(SPStyle const *style, SPStyle const *context_style)
        default:
            g_assert_not_reached();
    }
    switch (style->stroke_linejoin.computed) {
    switch (style->stroke_linejoin.as_enum()) {
        case SP_STROKE_LINEJOIN_ROUND:
            line_join = CAIRO_LINE_JOIN_ROUND;
            break;
@@ -182,14 +182,14 @@ NRStyleData::NRStyleData(SPStyle const *style, SPStyle const *context_style)
        default:
            g_assert_not_reached();
    }
    miter_limit = style->stroke_miterlimit.value;
    miter_limit = style->stroke_miterlimit.as_double();

    int const n_dash = style->stroke_dasharray.values.size();
    if (n_dash > 0 && style->stroke_dasharray.is_valid()) {
        dash_offset = style->stroke_dashoffset.computed;
        dash_offset = style->stroke_dashoffset.as_double();
        dash.resize(n_dash);
        for (int i = 0; i < n_dash; ++i) {
            dash[i] = style->stroke_dasharray.values[i].computed;
            dash[i] = style->stroke_dasharray.values[i].as_double();
        }
    }

@@ -244,8 +244,8 @@ NRStyleData::NRStyleData(SPStyle const *style, SPStyle const *context_style)
    // decoration to the fill and stroke values of that ancestor.
    auto style_td = style;
    if (style->text_decoration.style_td) style_td = style->text_decoration.style_td;
    text_decoration_stroke.opacity = SP_SCALE24_TO_FLOAT(style_td->stroke_opacity.value);
    text_decoration_stroke_width = style_td->stroke_width.computed;
    text_decoration_stroke.opacity = style_td->stroke_opacity.as_double();
    text_decoration_stroke_width = style_td->stroke_width.as_double();

    // Priority is given in order:
    //   * text_decoration_fill
@@ -292,10 +292,10 @@ NRStyleData::NRStyleData(SPStyle const *style, SPStyle const *context_style)
        underline_position     = style->text_decoration_data.underline_position;
        line_through_thickness = style->text_decoration_data.line_through_thickness;
        line_through_position  = style->text_decoration_data.line_through_position;
        font_size              = style->font_size.computed;
        font_size              = style->font_size;
    }

    text_direction = style->direction.computed;
    text_direction = style->direction.as_enum();
}

auto NRStyle::preparePaint(Inkscape::DrawingContext &dc, Inkscape::RenderContext &rc, Geom::IntRect const &area, Geom::OptRect const &paintbox, Inkscape::DrawingPattern const *pattern, NRStyleData::Paint const &paint, CachedPattern const &cp) const -> CairoPatternUniqPtr
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ struct NRStyleData
    Paint stroke;
    float stroke_width;
    bool hairline;
    float miter_limit;
    double miter_limit;
    std::vector<double> dash;
    float dash_offset;
    cairo_fill_rule_t fill_rule;
+4 −4
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ void TranslucencyGroup::setSolidItem(SPItem *item)
    // Reset all the items in the list.
    for (auto &item : _translucent_items) {
        if (auto arenaitem = item->get_arenaitem(_dkey)) {
            arenaitem->setOpacity(SP_SCALE24_TO_FLOAT(item->style->opacity.value));
            arenaitem->setOpacity(item->style->opacity.as_double());
        }
    }
    _translucent_items.clear();