BUDAPEST — Lawmakers in Hungary passed legislation Tuesday that prohibits sharing with minors any content that portrays being gay or transgender, something supporters said would help fight pedophilia but which human rights groups denounced as anti-LGBT discrimination. The conservative ruling party of Hungarian Prime Minister Viktor Orban introduced the legislation, which is the latest effort to curtail the rights of gay men, lesbians, bisexual and transgender people in the central European nation. Hungary’s National Assembly passed the bill on a 157-1 vote. The ruling Fidesz party has a parliamentary majority, and lawmakers from the right-wing Jobbik party also endorsed the measure. One independent lawmaker voted against it. All other opposition parties boycotted the voting session in protest. Human rights groups had denounced the measure strongly, seeing it as a tool that could be used to stigmatize and harass residents because of their sexual orientations and gender identities.