Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. It works - with parts left over

It works - with parts left over

Scheduled Pinned Locked Moved The Lounge
graphicsdesigncomiothelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    honey the codewitch
    wrote on last edited by
    #1

    :~ The code below successfully draws a rounded pushbutton (without text since my SVG engine doesn't support text directly and i haven't added the text drawing code yet) I just fired it up this morning and wrote it and it worked. Last time it didn't. I have no idea why. I've changed some things but nothing that should have destroyed it to where it silently failed. I'm not sure whether I'm happy about this or not. dumb button (without text) in svg - YouTube[^]

    if(m_doc_dirty) {
    gfx_result res;
    svg_doc_builder builder(ssizef(destination.dimensions().width,destination.dimensions().width));
    svg_shape_info si;
    si.stroke.color = color<rgba_pixel<32>>::white;
    si.stroke.type = svg_paint_type::color;
    si.fill.type = svg_paint_type::color;
    si.fill.color = m_pressed ? color<rgba_pixel<32>>::red : color<rgba_pixel<32>>::purple;
    srect16 b = this->bounds().dimensions().bounds(); // zero out top left
    res = builder.add_rounded_rectangle(rectf(b.x1,b.y1,b.x2,b.y2),{10,10}, si);
    if (res != gfx_result::success) {
    Serial.printf("Error: %d\r\n", (int)res);
    return;
    }
    builder.to_doc(&m_doc);
    m_doc_dirty = false;
    }

    Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

    C E 2 Replies Last reply
    0
    • H honey the codewitch

      :~ The code below successfully draws a rounded pushbutton (without text since my SVG engine doesn't support text directly and i haven't added the text drawing code yet) I just fired it up this morning and wrote it and it worked. Last time it didn't. I have no idea why. I've changed some things but nothing that should have destroyed it to where it silently failed. I'm not sure whether I'm happy about this or not. dumb button (without text) in svg - YouTube[^]

      if(m_doc_dirty) {
      gfx_result res;
      svg_doc_builder builder(ssizef(destination.dimensions().width,destination.dimensions().width));
      svg_shape_info si;
      si.stroke.color = color<rgba_pixel<32>>::white;
      si.stroke.type = svg_paint_type::color;
      si.fill.type = svg_paint_type::color;
      si.fill.color = m_pressed ? color<rgba_pixel<32>>::red : color<rgba_pixel<32>>::purple;
      srect16 b = this->bounds().dimensions().bounds(); // zero out top left
      res = builder.add_rounded_rectangle(rectf(b.x1,b.y1,b.x2,b.y2),{10,10}, si);
      if (res != gfx_result::success) {
      Serial.printf("Error: %d\r\n", (int)res);
      return;
      }
      builder.to_doc(&m_doc);
      m_doc_dirty = false;
      }

      Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

      C Offline
      C Offline
      charlieg
      wrote on last edited by
      #2

      you know what happens when you even think "I don't know why" right? Same as "the bug went away..."

      Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.

      1 Reply Last reply
      0
      • H honey the codewitch

        :~ The code below successfully draws a rounded pushbutton (without text since my SVG engine doesn't support text directly and i haven't added the text drawing code yet) I just fired it up this morning and wrote it and it worked. Last time it didn't. I have no idea why. I've changed some things but nothing that should have destroyed it to where it silently failed. I'm not sure whether I'm happy about this or not. dumb button (without text) in svg - YouTube[^]

        if(m_doc_dirty) {
        gfx_result res;
        svg_doc_builder builder(ssizef(destination.dimensions().width,destination.dimensions().width));
        svg_shape_info si;
        si.stroke.color = color<rgba_pixel<32>>::white;
        si.stroke.type = svg_paint_type::color;
        si.fill.type = svg_paint_type::color;
        si.fill.color = m_pressed ? color<rgba_pixel<32>>::red : color<rgba_pixel<32>>::purple;
        srect16 b = this->bounds().dimensions().bounds(); // zero out top left
        res = builder.add_rounded_rectangle(rectf(b.x1,b.y1,b.x2,b.y2),{10,10}, si);
        if (res != gfx_result::success) {
        Serial.printf("Error: %d\r\n", (int)res);
        return;
        }
        builder.to_doc(&m_doc);
        m_doc_dirty = false;
        }

        Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

        E Offline
        E Offline
        englebart
        wrote on last edited by
        #3

        Normally, these mysteries boil down to… I turned off the autobuild setting!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups