久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <legend id='D2BEU'><style id='D2BEU'><dir id='D2BEU'><q id='D2BEU'></q></dir></style></legend>

    1. <i id='D2BEU'><tr id='D2BEU'><dt id='D2BEU'><q id='D2BEU'><span id='D2BEU'><b id='D2BEU'><form id='D2BEU'><ins id='D2BEU'></ins><ul id='D2BEU'></ul><sub id='D2BEU'></sub></form><legend id='D2BEU'></legend><bdo id='D2BEU'><pre id='D2BEU'><center id='D2BEU'></center></pre></bdo></b><th id='D2BEU'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='D2BEU'><tfoot id='D2BEU'></tfoot><dl id='D2BEU'><fieldset id='D2BEU'></fieldset></dl></div>

      1. <tfoot id='D2BEU'></tfoot>
          <bdo id='D2BEU'></bdo><ul id='D2BEU'></ul>

        <small id='D2BEU'></small><noframes id='D2BEU'>

      2. 如何從 kivy 小部件畫布中刪除特定說明?

        How can I remove specific instructions from kivy widget canvas?(如何從 kivy 小部件畫布中刪除特定說明?)
      3. <i id='IQvv4'><tr id='IQvv4'><dt id='IQvv4'><q id='IQvv4'><span id='IQvv4'><b id='IQvv4'><form id='IQvv4'><ins id='IQvv4'></ins><ul id='IQvv4'></ul><sub id='IQvv4'></sub></form><legend id='IQvv4'></legend><bdo id='IQvv4'><pre id='IQvv4'><center id='IQvv4'></center></pre></bdo></b><th id='IQvv4'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='IQvv4'><tfoot id='IQvv4'></tfoot><dl id='IQvv4'><fieldset id='IQvv4'></fieldset></dl></div>
          <tfoot id='IQvv4'></tfoot>
          • <bdo id='IQvv4'></bdo><ul id='IQvv4'></ul>
              <tbody id='IQvv4'></tbody>

                <small id='IQvv4'></small><noframes id='IQvv4'>

                  <legend id='IQvv4'><style id='IQvv4'><dir id='IQvv4'><q id='IQvv4'></q></dir></style></legend>
                1. 本文介紹了如何從 kivy 小部件畫布中刪除特定說明?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在編寫一個(gè)基于 kivy 的圖形應(yīng)用程序,我可以在其中動(dòng)態(tài)地將節(jié)點(diǎn)添加到繪圖區(qū)域,然后將它們與有向線 (=edge) 連接起來.節(jié)點(diǎn)可以在繪圖區(qū)域內(nèi)拖動(dòng),邊緣應(yīng)始終與它們保持連接.

                  I’m writing a kivy based graph app where I can dynamically add nodes to a draw area and then connect them with directed lines(=edge). Nodes can be dragged inside the draw area and edges should stay connected to them always.

                  Edge 類派生自 Widget 類.它的圖形表示由兩部分組成,線本身(=線)和線的尖端(=三角形).當(dāng)一個(gè) Edge 小部件被繪制時(shí),它的畫布首先被平移和旋轉(zhuǎn),然后邊緣的尖端被繪制到畫布上.之后,畫布被旋轉(zhuǎn)回原來的位置,線條部分被繪制到canvas.after.

                  Edge class is derived from Widget class. Its graphical presentation consists of two parts, the line itself(=Line) and the tip of the line(=Triangle). When an Edge widget is drawn, its canvas is at first translated and rotated after which the tip of the edge is drawn to the canvas. After that, the canvas is rotated back to its original position and the line part is drawn to canvas.after.

                  當(dāng)節(jié)點(diǎn)移動(dòng)時(shí),Edge 小部件的畫布被清除并再次繪制圖形表示.然而,這并沒有按我的計(jì)劃工作.

                  When nodes are moved, the canvas of the Edge widget is cleared and the graphical presentation is drawn again. However, this doesn’t work as I planned.

                  如果我在 Edge 類的 draw 方法的開頭使用 self.canvas.clear() ,舊線不會(huì)被刪除,我會(huì)在畫布上得到多條線.

                  If I use self.canvas.clear() at the beginning of the draw method of the Edge class, the old line is not removed and I get multiple lines on the canvas.

                  如果我使用 self.canvas.after.clear(),我的繪圖區(qū)域會(huì)完全混亂,因?yàn)?clear 方法還會(huì)從 canvas.after 中刪除 PopMatrix 指令.

                  If I use self.canvas.after.clear() I get a completely messed up view of my draw area, since the clear method also removes the PopMatrix instruction from the canvas.after.

                  我怎樣才能從 canvas.after 中刪除線條的圖形表示?有更好的方法嗎?

                  我的 Edge 類的 Kivy 文件:

                  Kivy file of my Edge class:

                  <Edge>:
                      id: ed
                      size_hint: None, None
                      canvas.before:
                          Color:
                              rgb: 0.9, 0.1, 0.1
                          PushMatrix
                          Translate:
                              x: ed.translate_x
                              y: ed.translate_y
                          Rotate:
                              angle: ed.rot_angle
                              origin: ed.rot_origin_x, ed.rot_origin_y
                      canvas.after:
                          PopMatrix
                  

                  更新我改變了我的方法,現(xiàn)在我在畫布上繪制所有內(nèi)容,而不是在畫布和 canvas.after 上繪制.現(xiàn)在我得到了我想要的結(jié)果,但如果有人知道如何刪除單獨(dú)的畫布指令,我會(huì)很高興知道.

                  UPDATE I changed my approach and now I draw everything on the canvas instead of drawing to canvas and canvas.after. Now I got the result that I wanted, but still if someone knows how to remove the individual canvas instructions it would be nice to know.

                  推薦答案

                  你可以:

                  1. 通過執(zhí)行 canvas.remove() 刪除畫布的子項(xiàng),并傳遞所需的圖形指令實(shí)例.您可以使用 canvas.children 進(jìn)行迭代并獲得一個(gè).

                  1. remove a children of a canvas by doing canvas.remove() and pass the instance of the graphics instructions you want. You can iterate and get the one with canvas.children.

                  group 名稱分配給畫布屬性,然后使用 canvas.remove_group().這是分類和刪除大量圖形指令而不保留對(duì)它們的引用的最佳方法.

                  assign a group name to a canvas property, then use canvas.remove_group(). This is the best way to categorize and remove lot of graphics instructions without keeping a reference to them.

                  這篇關(guān)于如何從 kivy 小部件畫布中刪除特定說明?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個(gè)在 Python 中提供角色的不和諧機(jī)器人?)
                  Discord bot isn#39;t responding to commands(Discord 機(jī)器人沒有響應(yīng)命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關(guān)于我嗎?Discord 機(jī)器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機(jī)器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動(dòng)更改角色顏色)

                    <bdo id='tGWS1'></bdo><ul id='tGWS1'></ul>
                      <tbody id='tGWS1'></tbody>

                    <small id='tGWS1'></small><noframes id='tGWS1'>

                    <legend id='tGWS1'><style id='tGWS1'><dir id='tGWS1'><q id='tGWS1'></q></dir></style></legend>
                  • <tfoot id='tGWS1'></tfoot>

                            <i id='tGWS1'><tr id='tGWS1'><dt id='tGWS1'><q id='tGWS1'><span id='tGWS1'><b id='tGWS1'><form id='tGWS1'><ins id='tGWS1'></ins><ul id='tGWS1'></ul><sub id='tGWS1'></sub></form><legend id='tGWS1'></legend><bdo id='tGWS1'><pre id='tGWS1'><center id='tGWS1'></center></pre></bdo></b><th id='tGWS1'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='tGWS1'><tfoot id='tGWS1'></tfoot><dl id='tGWS1'><fieldset id='tGWS1'></fieldset></dl></div>
                            主站蜘蛛池模板: 国产成人免费视频网站高清观看视频 | 久久久久久久夜 | www.久久久久久久久 | 国产一区二区精品在线观看 | 精品无码久久久久久国产 | 国产成人99久久亚洲综合精品 | 在线免费观看亚洲 | 色资源站 | www.亚洲 | 国产97久久 | 国产精品一级 | 成人高清在线视频 | 午夜色播| 在线一区视频 | 午夜手机在线 | 免费在线观看一区二区三区 | 亚洲一区 中文字幕 | 91在线免费视频 | 欧美成人精品在线 | 欧美精品一区二区三区蜜桃视频 | 久在线视频播放免费视频 | 日韩一区二区久久 | 毛片网在线观看 | 久久久久久久一区二区 | 亚洲精品二区 | 久久高清国产视频 | 亚洲成人三级 | 欧洲一区视频 | 午夜资源 | 国产视频1区| 91麻豆精品国产91久久久更新资源速度超快 | 精品一二区 | 日本不卡在线观看 | 99精品久久| 亚洲精品电影网在线观看 | 国内精品视频在线观看 | 草久视频| 国产一级毛片精品完整视频版 | 国产高清一区二区三区 | 99精品国自产在线观看 | 欧美一区二区三区 |