修改SVG路径

时间:2015-11-13 10:00:14

标签: svg svg-path

我一直在尝试通过编辑路径元素来编辑我的SVG几个小时,但我无法得到我想要的结果:

代码如下所示:

@Component
public class UserRoutingDataSource extends AbstractRoutingDataSource {

    @Autowired
    public UserRoutingDataSource(CustomDatabasesDAO customDatabasesDAO) {
        Map<Object, Object> targetDataSources = new HashMap<Object, Object>();

        for(CustomDatabases database : customDatabasesDAO.findDatabasesByDeleted(0))
        {
            DriverManagerDataSource datasource = new DriverManagerDataSource();
            datasource.setDriverClassName(database.getCdboDriverName());
            datasource.setUrl("jdbc:sqlserver://"+database.getCdboServer()+":"+database.getCdboPort()+";databaseName="+database.getCdboAliasName() + ";");
            datasource.setUsername(database.getCdboUserName());
            datasource.setPassword(database.getCdboPassword());

            targetDataSources.put(database.getCdboDatabaseId(), datasource);
        }

        /*
         * This default datasource is necessary because for some reason (Hibernate, JPA related ?) the routing datasource 
         * calls the "determineCurrentLookupKey()" on startup which returned null ("default" now) because there is no Authentication at startup yet.
         */
        targetDataSources.put("default", new DriverManagerDataSource());    
        setTargetDataSources(targetDataSources);
        afterPropertiesSet();
    }

    @Override
    protected Object determineCurrentLookupKey() {
        UsernamePasswordAuthenticationToken auth = (UsernamePasswordAuthenticationToken) SecurityContextHolder.getContext().getAuthentication();

        if (auth != null && auth.getDetails() instanceof Map)
        {
            HashMap<String, Object> details = (HashMap<String, Object>) auth.getDetails();
            return details.get("databaseId");
        }

        return "default";
    }
}

渲染的图形如下所示:

SVG output

我想要做的是编辑内黑圈;我需要移除圆圈的右半部分。

我搜索了解释如何操作的网站,但我没有找到任何帮助。

是否可以将代码粘贴到SVG编辑器中,然后编辑图像并获取代码?

非常感谢帮助。

1 个答案:

答案 0 :(得分:1)

用四个三次贝塞尔曲线命令绘制内圆。只需删除绘制内圈右侧的两个命令。

<svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" class="circle style-scope iron-icon" style="pointer-events: none; display: block; width: 24px; height: 24px;">
    <g class=" style-scope iron-icon">
      <path d="M12 7 c-2.76 0-5 2.24-5 5 s2.24 5 5 5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" class="style-scope iron-icon">
      </path> 
    </g>
</svg>

可以在以下位置找到三次贝塞尔曲线命令的说明: http://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands

相关问题